Skip to content

Commit 54646af

Browse files
committed
Fixes
1 parent 0c7f7a5 commit 54646af

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/libcollections/str.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,6 +1339,12 @@ pub trait StrExt: Index<FullRange, Output = str> {
13391339
fn trim_left(&self) -> &str {
13401340
UnicodeStr::trim_left(self.index(&FullRange))
13411341
}
1342+
1343+
/// Returns a string with trailing whitespace removed.
1344+
#[stable]
1345+
fn trim_right(&self) -> &str {
1346+
UnicodeStr::trim_right(self.index(&FullRange))
1347+
}
13421348
}
13431349

13441350
#[stable]
@@ -1349,8 +1355,7 @@ mod tests {
13491355
use prelude::*;
13501356

13511357
use core::iter::AdditiveIterator;
1352-
use super::from_utf8;
1353-
use super::Utf8Error;
1358+
use super::{from_utf8, Utf8Error};
13541359

13551360
#[test]
13561361
fn test_le() {

0 commit comments

Comments
 (0)