about summary refs log tree commit diff
path: root/src/libstd/vec.rs
AgeCommit message (Collapse)AuthorLines
2013-12-17std::vec: convert .copy_memory to use copy_nonoverlapping_memory.Huon Wilson-5/+5
It is required that &mut[]s are disjoint from all other &(mut)[]s, so this assumption is ok.
2013-12-17std::vec::bytes: remove the reference to overlapping src and dest inHuon Wilson-7/+4
docs for copy_memory. &mut [u8] and &[u8] really shouldn't be overlapping at all (part of the uniqueness/aliasing guarantee of &mut), so no point in encouraging it.
2013-12-17std::vec::raw: convert copy_memory to a method.Huon Wilson-20/+21
2013-12-17std::vec::raw: convert init_elem to a method.Huon Wilson-16/+16
2013-12-16vec: avoid some unsafe code in MoveIterator's dtorDaniel Micay-4/+2
2013-12-17std::vec: remove aliasing &mut [] and &[] from shift_opt.Huon Wilson-43/+27
Also, dramatically simplify it with some tasteful raw pointers, rather than treating everything as a nail with `transmute`.
2013-12-16vec: make the move iterator fast for all typesDaniel Micay-42/+42
Closes #10976
2013-12-15librustc: Remove identifiers named `box`, since it's about to become a keyword.Patrick Walton-2/+2
2013-12-15auto merge of #10984 : huonw/rust/clean-raw, r=cmrbors-145/+94
See commits for details.
2013-12-15std::vec: convert to(_mut)_ptr to as_... methods on &[] and &mut [].Huon Wilson-33/+44
2013-12-15Move std::{str,vec}::raw::set_len to an unsafe method on Owned{Vector,Str}.Huon Wilson-33/+33
2013-12-15std::vec: move pointless `raw::get` and `unsafe_get` functions.Huon Wilson-16/+0
This can easily be written as `(*v.unsafe_ref(i)).clone()`, or just `*v.unsafe_ref(i)` for primitive types like `i32` (the common case).
2013-12-15std::vec::raw: clean up docs.Huon Wilson-4/+6
2013-12-15std::vec::bytes: remove obsolete functions.Huon Wilson-44/+2
These are less useful versions of the comparison operators and TotalOrd trait.
2013-12-15std::vec: remove unnecessary count parameter on {bytes,Huon Wilson-18/+12
raw}::copy_memory. Slices carry their length with them, so we can just use that information.
2013-12-15std: fix spelling in docs.Huon Wilson-8/+9
2013-12-12Inline Finallyalizer::drop, allowing LLVM to optimize `finally`.Eduard Burtescu-0/+55
* fixes the vec::from_elem regression caused by #8780 * added 5 benchmarks for allocating a 1KB ~[u8] and zeroing it
2013-12-11Make 'self lifetime illegal.Erik Price-145/+145
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-03add MutableVector::mut_split(self, pred) -> DoubleEndedIterator<&mut [T]>Guillaume Pinot-4/+110
This method is the mutable version of ImmutableVector::split. It is a DoubleEndedIterator, making mut_rsplit irrelevent. The size_hint method is not optimal because of #9629. At the same time, clarify *split* iterator doc.
2013-12-02rename MutableVector::mut_split(at) to MutableVector::mut_split_at(at)Guillaume Pinot-6/+6
2013-11-30Implement DoubleEndedIterator for MutChunkIter.Palmer Cox-0/+29
2013-11-30Implement mut_chunks() method for MutableVector trait.Palmer Cox-0/+73
mut_chunks() returns an iterator that produces mutable slices. This is the mutable version of the existing chunks() method on the ImmutableVector trait.
2013-11-29Removed a few macro-expanding-to-module workaroundsMarvin Löbel-26/+5
Also documented a few issues
2013-11-28auto merge of #10519 : ↵bors-0/+194
nikomatsakis/rust/issue-8624-borrowck-overly-permissive, r=pnkfelix See #8624 for details. r? @pnkfelix
2013-11-26librustc: Fix merge fallout.Patrick Walton-2/+2
2013-11-26libstd: Fix Win32 and other bustage.Patrick Walton-16/+16
2013-11-26test: Remove non-procedure uses of `do` from compiletest, libstd tests,Patrick Walton-2/+6
compile-fail tests, run-fail tests, and run-pass tests.
2013-11-26libstd: Remove all non-`proc` uses of `do` from libstdPatrick Walton-50/+46
2013-11-26librustc: Remove remaining uses of `&fn()` in favor of `||`.Patrick Walton-10/+10
2013-11-26Removed unneccessary `_iter` suffixes from various APIsMarvin Löbel-60/+65
2013-11-26std: Remove unused attributesklutzy-2/+2
This also enables two tests properly.
2013-11-25Add [mut_]shift_ref/[mut_]pop_ref functions, which return a pointer to the ↵Niko Matsakis-0/+194
first/last item in the slice and modify the slice to exclude the returned item. Useful when writing iterators over mutable references.
2013-11-22Add more benchmark tests to vec.rsg3xzh-2/+70
New benchmark tests in vec.rs: `push`, `starts_with_same_vector`, `starts_with_single_element`, `starts_with_diff_one_element_end`, `ends_with_same_vector`, `ends_with_single_element`, `ends_with_diff_one_element_beginning` and `contains_last_element`
2013-11-21`std::ptr::read_ptr` now takes `*T` instead of `*mut T`Ziad Hatahet-1/+1
Closes #10579
2013-11-19libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstdPatrick Walton-27/+29
2013-11-11vec: with_capacity: check for overflowCorey Richardson-1/+5
Fixes #10271
2013-11-08add `clone_from` and `deep_clone_from`Daniel Micay-1/+23
Closes #10240
2013-11-06Register new snapshotsAlex Crichton-14/+1
2013-11-05Rename misleading contains_managed to owns_managedNiko Matsakis-8/+21
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-16/+16
Who doesn't like a massive renaming?
2013-10-17std: Move size/align functions to std::mem. #2240Brian Anderson-22/+22
2013-10-17auto merge of #9908 : alexcrichton/rust/snapshots, r=thestingerbors-80/+0
2013-10-17Register new snapshotsAlex Crichton-80/+0
2013-10-16Implement new methods vec.starts_with()/vec.ends_with()Kevin Ballard-0/+46
2013-10-16Rewrite vec.contains() to be simplerKevin Ballard-2/+2
2013-10-16auto merge of #9833 : alexcrichton/rust/fixes, r=brsonbors-0/+1
Commits have all the fun details
2013-10-15Require module documentation with missing_docAlex Crichton-0/+1
Closes #9824
2013-10-15use element count in slices, not size in bytesDaniel Micay-0/+81
This allows the indexing bounds check or other comparisons against an element length to avoid a multiplication by the size.
2013-10-14std::vec: move documentation from impls to traits.Huon Wilson-302/+303
This means the text is visible in rustdoc.
2013-10-12auto merge of #9608 : hmarr/rust/vec-get-opt, r=huonwbors-0/+18
This adds `get_opt` to `std::vec`, which looks up an item by index and returns an `Option`. If the given index is out of range, `None` will be returned, otherwise a `Some`-wrapped item will be returned. Example use case: ```rust use std::os; fn say_hello(name: &str) { println(fmt!("Hello, %s", name)); } fn main(){ // Try to get the first cmd line arg, but default to "World" let args = os::args(); let default = ~"World"; say_hello(*args.get_opt(1).unwrap_or(&default)); } ``` If there's an existing way of implementing this pattern that's cleaner, I'll happily close this. I'm also open to naming suggestions (`index_opt`?)