From 7bc85e29c94084a5b24af4b38a6d9dd7f9177f06 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Wed, 8 Jul 2020 12:44:43 +0800 Subject: Liballoc use vec instead of vector Keep congruency with other parts, full word vector is rarely used. --- src/liballoc/slice.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/liballoc') diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index d7dc2174d66..3dbe2442866 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -156,9 +156,9 @@ mod hack { where T: Clone, { - let mut vector = Vec::with_capacity(s.len()); - vector.extend_from_slice(s); - vector + let mut vec = Vec::with_capacity(s.len()); + vec.extend_from_slice(s); + vec } } -- cgit 1.4.1-3-g733a5 From 09654430017b9ed8488ca45c414410af1417a482 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Wed, 8 Jul 2020 12:47:19 +0800 Subject: Remove unneeded ToString import in liballoc slice --- src/liballoc/slice.rs | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/liballoc') diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index d7dc2174d66..daa1a13c1ea 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -136,8 +136,6 @@ pub use hack::to_vec; // `test_permutations` test mod hack { use crate::boxed::Box; - #[cfg(test)] - use crate::string::ToString; use crate::vec::Vec; // We shouldn't add inline attribute to this since this is used in -- cgit 1.4.1-3-g733a5