about summary refs log tree commit diff
path: root/src/libstd/collections
diff options
context:
space:
mode:
authorStjepan Glavina <stjepang@gmail.com>2017-01-13 01:57:48 +0100
committerStjepan Glavina <stjepang@gmail.com>2017-01-13 01:57:48 +0100
commitd5c3becf00452fd1d35e695494d7ae41dedb11d8 (patch)
tree3bcc12a08e1317e692612e2478ba7811b08eb281 /src/libstd/collections
parente35717814686ea3e3d44a8f5c1c20d1cd50be82a (diff)
Change `to_owned` to `to_string` in docs
We should teach conversion from `str` to `String` using `to_string`
rather than the legacy `to_owned`.
Diffstat (limited to 'src/libstd/collections')
-rw-r--r--src/libstd/collections/hash/map.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs
index 2fa3a9c4844..a314717a877 100644
--- a/src/libstd/collections/hash/map.rs
+++ b/src/libstd/collections/hash/map.rs
@@ -1779,11 +1779,11 @@ impl<'a, K, V> Entry<'a, K, V> {
     /// use std::collections::HashMap;
     ///
     /// let mut map: HashMap<&str, String> = HashMap::new();
-    /// let s = "hoho".to_owned();
+    /// let s = "hoho".to_string();
     ///
     /// map.entry("poneyland").or_insert_with(|| s);
     ///
-    /// assert_eq!(map["poneyland"], "hoho".to_owned());
+    /// assert_eq!(map["poneyland"], "hoho".to_string());
     /// ```
     pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut V {
         match self {