File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -330,7 +330,7 @@ impl str {
330330 /// ```
331331 /// let mut v = String::from("🗻∈🌏");
332332 ///
333- /// assert_eq!(Some("🗻"), v.get(0..4);
333+ /// assert_eq!(Some("🗻"), v.get(0..4)) ;
334334 ///
335335 /// // indices not on UTF-8 sequence boundaries
336336 /// assert!(v.get_mut(1..).is_none());
@@ -573,12 +573,16 @@ impl str {
573573 /// Basic usage:
574574 ///
575575 /// ```
576- /// let mut s = "Per Martin-Löf".to_string();
577- ///
578- /// let (first, last) = s.split_at_mut(3);
576+ /// use std::ascii::AsciiExt;
579577 ///
580- /// assert_eq!("Per", first);
581- /// assert_eq!(" Martin-Löf", last);
578+ /// let mut s = "Per Martin-Löf".to_string();
579+ /// {
580+ /// let (first, last) = s.split_at_mut(3);
581+ /// first.make_ascii_uppercase();
582+ /// assert_eq!("PER", first);
583+ /// assert_eq!(" Martin-Löf", last);
584+ /// }
585+ /// assert_eq!("PER Martin-Löf", s);
582586 /// ```
583587 #[ inline]
584588 #[ stable( feature = "str_split_at" , since = "1.4.0" ) ]
You can’t perform that action at this time.
0 commit comments