From 0741dd795a5cad8b7bb24d07200235f8fb7d84e6 Mon Sep 17 00:00:00 2001 From: Utkarsh Kukreti Date: Fri, 7 Nov 2014 17:34:32 +0530 Subject: [PATCH] Remove unnecessary `.to_string()`s from `Vec.swap_remove`'s doc example. --- src/libcollections/vec.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 78ed5e97069..76399d42b8b 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -801,14 +801,13 @@ impl Vec { /// /// # Example /// ``` - /// let mut v = vec!["foo".to_string(), "bar".to_string(), - /// "baz".to_string(), "qux".to_string()]; + /// let mut v = vec!["foo", "bar", "baz", "qux"]; /// - /// assert_eq!(v.swap_remove(1), Some("bar".to_string())); - /// assert_eq!(v, vec!["foo".to_string(), "qux".to_string(), "baz".to_string()]); + /// assert_eq!(v.swap_remove(1), Some("bar")); + /// assert_eq!(v, vec!["foo", "qux", "baz"]); /// - /// assert_eq!(v.swap_remove(0), Some("foo".to_string())); - /// assert_eq!(v, vec!["baz".to_string(), "qux".to_string()]); + /// assert_eq!(v.swap_remove(0), Some("foo")); + /// assert_eq!(v, vec!["baz", "qux"]); /// /// assert_eq!(v.swap_remove(2), None); /// ```