We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c7f7a5 commit 54646afCopy full SHA for 54646af
src/libcollections/str.rs
@@ -1339,6 +1339,12 @@ pub trait StrExt: Index<FullRange, Output = str> {
1339
fn trim_left(&self) -> &str {
1340
UnicodeStr::trim_left(self.index(&FullRange))
1341
}
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
+ }
1348
1349
1350
#[stable]
@@ -1349,8 +1355,7 @@ mod tests {
1355
use prelude::*;
1356
1351
1357
use core::iter::AdditiveIterator;
1352
- use super::from_utf8;
1353
- use super::Utf8Error;
1358
+ use super::{from_utf8, Utf8Error};
1354
1359
1360
#[test]
1361
fn test_le() {
0 commit comments