Skip to content

Commit fa2983a

Browse files
committed
auto merge of #18735 : utkarshkukreti/rust/remove-unnecessary-to_string-from-vec-docs, r=huonw
I don't think they're needed.
2 parents 34af036 + 0741dd7 commit fa2983a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Diff for: src/libcollections/vec.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -801,14 +801,13 @@ impl<T> Vec<T> {
801801
///
802802
/// # Example
803803
/// ```
804-
/// let mut v = vec!["foo".to_string(), "bar".to_string(),
805-
/// "baz".to_string(), "qux".to_string()];
804+
/// let mut v = vec!["foo", "bar", "baz", "qux"];
806805
///
807-
/// assert_eq!(v.swap_remove(1), Some("bar".to_string()));
808-
/// assert_eq!(v, vec!["foo".to_string(), "qux".to_string(), "baz".to_string()]);
806+
/// assert_eq!(v.swap_remove(1), Some("bar"));
807+
/// assert_eq!(v, vec!["foo", "qux", "baz"]);
809808
///
810-
/// assert_eq!(v.swap_remove(0), Some("foo".to_string()));
811-
/// assert_eq!(v, vec!["baz".to_string(), "qux".to_string()]);
809+
/// assert_eq!(v.swap_remove(0), Some("foo"));
810+
/// assert_eq!(v, vec!["baz", "qux"]);
812811
///
813812
/// assert_eq!(v.swap_remove(2), None);
814813
/// ```

0 commit comments

Comments
 (0)