From 7d3b0bf3912fabf52fdd6926900e578e55af1b49 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 17 Apr 2014 15:28:14 -0700 Subject: std: Make ~[T] no longer a growable vector This removes all resizability support for ~[T] vectors in preparation of DST. The only growable vector remaining is Vec. In summary, the following methods from ~[T] and various functions were removed. Each method/function has an equivalent on the Vec type in std::vec unless otherwise stated. * slice::OwnedCloneableVector * slice::OwnedEqVector * slice::append * slice::append_one * slice::build (no replacement) * slice::bytes::push_bytes * slice::from_elem * slice::from_fn * slice::with_capacity * ~[T].capacity() * ~[T].clear() * ~[T].dedup() * ~[T].extend() * ~[T].grow() * ~[T].grow_fn() * ~[T].grow_set() * ~[T].insert() * ~[T].pop() * ~[T].push() * ~[T].push_all() * ~[T].push_all_move() * ~[T].remove() * ~[T].reserve() * ~[T].reserve_additional() * ~[T].reserve_exect() * ~[T].retain() * ~[T].set_len() * ~[T].shift() * ~[T].shrink_to_fit() * ~[T].swap_remove() * ~[T].truncate() * ~[T].unshift() * ~str.clear() * ~str.set_len() * ~str.truncate() Note that no other API changes were made. Existing apis that took or returned ~[T] continue to do so. [breaking-change] --- src/libstd/rt/args.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/libstd/rt') diff --git a/src/libstd/rt/args.rs b/src/libstd/rt/args.rs index 328de696914..abe2e2ab1dc 100644 --- a/src/libstd/rt/args.rs +++ b/src/libstd/rt/args.rs @@ -125,13 +125,14 @@ mod imp { unsafe fn load_argc_and_argv(argc: int, argv: **u8) -> ~[~[u8]] { use c_str::CString; use ptr::RawPtr; - use {slice, libc}; + use libc; use slice::CloneableVector; + use vec::Vec; - slice::from_fn(argc as uint, |i| { + Vec::from_fn(argc as uint, |i| { let cs = CString::new(*(argv as **libc::c_char).offset(i as int), false); cs.as_bytes_no_nul().to_owned() - }) + }).move_iter().collect() } #[cfg(test)] -- cgit 1.4.1-3-g733a5