diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-04-17 15:28:14 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-04-18 10:06:24 -0700 |
| commit | 7d3b0bf3912fabf52fdd6926900e578e55af1b49 (patch) | |
| tree | 8405cde2a32e6a2499b9262b5dff6dcb34f36d32 /src/libstd/rt | |
| parent | ce2bab68d69ee04e17c0165dbdb7b583d5a7c991 (diff) | |
| download | rust-7d3b0bf3912fabf52fdd6926900e578e55af1b49.tar.gz rust-7d3b0bf3912fabf52fdd6926900e578e55af1b49.zip | |
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<T>. 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]
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/args.rs | 7 |
1 files changed, 4 insertions, 3 deletions
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)] |
