File tree Expand file tree Collapse file tree 3 files changed +14
-67
lines changed Expand file tree Collapse file tree 3 files changed +14
-67
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: 21d12c029700adc158c5fb466384ccd8562a6915
4
+ refs/heads/snap-stage3: fddec2d88a1b44c6eb8922127b8683e1c6778052
5
5
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -903,6 +903,19 @@ impl<'a> Deref<String> for DerefString<'a> {
903
903
}
904
904
905
905
/// Convert a string slice to a wrapper type providing a `&String` reference.
906
+ ///
907
+ /// # Examples
908
+ ///
909
+ /// ```
910
+ /// use std::string::as_string;
911
+ ///
912
+ /// fn string_consumer(s: String) {
913
+ /// assert_eq!(s, "foo".to_string());
914
+ /// }
915
+ ///
916
+ /// let string = as_string("foo").clone();
917
+ /// string_consumer(string);
918
+ /// ```
906
919
#[ experimental]
907
920
pub fn as_string < ' a > ( x : & ' a str ) -> DerefString < ' a > {
908
921
DerefString { x : as_vec ( x. as_bytes ( ) ) }
You can’t perform that action at this time.
0 commit comments