mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-24 21:53:56 +00:00
Add doctests for directionality
Thanks @nodakai
This commit is contained in:
parent
5a5aacac1f
commit
c0ace5dc16
@ -1531,6 +1531,16 @@ impl str {
|
||||
///
|
||||
/// assert_eq!("Hello\tworld\t", s.trim_left());
|
||||
/// ```
|
||||
///
|
||||
/// Directionality:
|
||||
///
|
||||
/// ```
|
||||
/// let s = " English";
|
||||
/// assert!(Some('E') == s.trim_left().chars().next());
|
||||
///
|
||||
/// let s = " עברית";
|
||||
/// assert!(Some('ע') == s.trim_left().chars().next());
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn trim_left(&self) -> &str {
|
||||
UnicodeStr::trim_left(self)
|
||||
@ -1557,6 +1567,16 @@ impl str {
|
||||
///
|
||||
/// assert_eq!(" Hello\tworld", s.trim_right());
|
||||
/// ```
|
||||
///
|
||||
/// Directionality:
|
||||
///
|
||||
/// ```
|
||||
/// let s = "English ";
|
||||
/// assert!(Some('h') == s.trim_right().chars().rev().next());
|
||||
///
|
||||
/// let s = "עברית ";
|
||||
/// assert!(Some('ת') == s.trim_right().chars().rev().next());
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn trim_right(&self) -> &str {
|
||||
UnicodeStr::trim_right(self)
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit af77843345ec6fc7e51113bfd692138d89024bc0
|
||||
Subproject commit 30f70baa6cc1ba3ddebb55b988fafbad0c0cc810
|
2
src/llvm
2
src/llvm
@ -1 +1 @@
|
||||
Subproject commit 3564439515985dc1cc0d77057ed00901635a80ad
|
||||
Subproject commit de5c31045dc0f6da1f65d02ee640ccf99ba90e7c
|
Loading…
Reference in New Issue
Block a user