about summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2016-05-12doc: line these comments upTshepang Lekhonkhobe-1/+1
Looks more nice, and same is done with prior examples
2016-05-12doc: Fix comment in std::string::String example codeHaiko Schol-1/+1
2016-05-12rustbuild: Add support for crate tests + doctestsAlex Crichton-1/+4
This commit adds support to rustbuild to run crate unit tests (those defined by `#[test]`) as well as documentation tests. All tests are powered by `cargo test` under the hood. Each step requires the `libtest` library is built for that corresponding stage. Ideally the `test` crate would be a dev-dependency, but for now it's just easier to ensure that we sequence everything in the right order. Currently no filtering is implemented, so there's not actually a method of testing *only* libstd or *only* libcore, but rather entire swaths of crates are tested all at once. A few points of note here are: * The `coretest` and `collectionstest` crates are just listed as `[[test]]` entires for `cargo test` to naturally pick up. This mean that `cargo test -p core` actually runs all the tests for libcore. * Libraries that aren't tested all mention `test = false` in their `Cargo.toml` * Crates aren't currently allowed to have dev-dependencies due to rust-lang/cargo#860, but we can likely alleviate this restriction once workspaces are implemented. cc #31590
2016-05-11Rollup merge of #33129 - GuillaumeGomez:fmt_doc, r=steveklabnikSteve Klabnik-0/+12
Doc improvement on std::fmt module Part of #29355. r? @steveklabnik
2016-05-10Doc improvement on std::fmt moduleGuillaume Gomez-0/+12
2016-05-07Rollup merge of #33402 - shepmaster:copied-variable-name, r=ManishearthSteve Klabnik-2/+2
Replace copy-pasted variable name with relevant one
2016-05-04Replace copy-pasted variable name with relevant oneJake Goulding-2/+2
2016-05-03Rollup merge of #33277 - birkenfeld:fmt-named-dollar-args, r=steveklabnikManish Goregaokar-4/+9
Fix std::fmt format spec: named args are allowed with "$" syntax
2016-04-30Auto merge of #33276 - bwinterton:btreeset-insert-doc-fix, r=GuillaumeGomezbors-2/+2
Make BTreeSet::Insert docs more consistent Made the BTreeSet::Insert documentation consistent with the HashSet::Insert documentation by using the term 'value' instead of 'key'. r? @steveklabnik
2016-04-29Auto merge of #33148 - sfackler:entry-key, r=alexcrichtonbors-0/+9
Add Entry::key This method was present on both variants of Entry, but not the enum cc #32281 r? @alexcrichton
2016-04-29Fix std::fmt format spec: named args are allowed with "$" syntaxGeorg Brandl-4/+9
2016-04-29Make Btreeset::Insert docs more consistentBrayden Winterton-2/+2
2016-04-28Clarify std::fmt width docs w.r.t. dollar syntax and give example.Georg Brandl-2/+13
2016-04-22Implement `append` for b-trees.Johannes Oertel-24/+339
The algorithm implemented here is linear in the size of the two b-trees. It firsts creates a `MergeIter` from the two b-trees and then builds a new b-tree by pushing key-value pairs from the `MergeIter` into nodes at the right heights. Three functions for stealing have been added to the implementation of `Handle` as well as a getter for the height of a `NodeRef`. The docs have been updated with performance information about `BTreeMap::append` and the remark about B has been removed now that it is the same for all instances of `BTreeMap`.
2016-04-21Add Entry::keySteven Fackler-0/+9
This method was present on both variants of Entry, but not the enum cc #32281
2016-04-20Auto merge of #32951 - LukasKalbertodt:collection_contains_rfc1552, r=brsonbors-0/+21
Add `contains` to `VecDeque` and `LinkedList` (+ tests) This implements [RFC 1552](https://github.com/rust-lang/rfcs/blob/master/text/1552-contains-method-for-various-collections.md). Tracking issue: #32630 Sorry for the late response. This is my first contribution, so please tell me if anything isn't optimal!
2016-04-18Auto merge of #32866 - davidhewitt:master, r=apasel422bors-0/+179
Implement `From<Vec<T>>` and `Into<Vec<T>>` for `VecDeque<T>`
2016-04-18Added From<VecDeque<T>> for Vec<T> and From<Vec<T>> for VecDeque<T>David Hewitt-0/+179
2016-04-17Auto merge of #33050 - apasel422:bh, r=alexcrichtonbors-0/+1
Implement `Clone` for `binary_heap::IntoIter` r? @alexcrichton
2016-04-17Implement `Clone` for `binary_heap::IntoIter`Andrew Paseltiner-0/+1
2016-04-17Rollup merge of #31441 - gereeter:btree-docs, r=blussManish Goregaokar-5/+176
Start documenting BTreeMap's node interface cc @Gankro @apasel422
2016-04-17Auto merge of #32987 - xosmig:binary_heap_extension, r=apasel422bors-5/+88
collections: add append for binary heap
2016-04-16Auto merge of #32977 - alexcrichton:ignore-panics, r=brsonbors-4/+8
std: Change String::truncate to panic less The `Vec::truncate` method does not panic if the length argument is greater than the vector's current length, but `String::truncate` will indeed panic. This semantic difference can be a bit jarring (e.g. #32717), and after some discussion the libs team concluded that although this can technically be a breaking change it is almost undoubtedly not so in practice. This commit changes the semantics of `String::truncate` to be a noop if `new_len` is greater than the length of the current string. Closes #32717
2016-04-15slice: Add tracking issue for slice_binary_search_by_keyKamal Marhubi-1/+1
2016-04-16collections: add append and extend specialization for binary heapAndrey Tonkih-5/+88
2016-04-15std: Change String::truncate to panic lessAlex Crichton-4/+8
The `Vec::truncate` method does not panic if the length argument is greater than the vector's current length, but `String::truncate` will indeed panic. This semantic difference can be a bit jarring (e.g. #32717), and after some discussion the libs team concluded that although this can technically be a breaking change it is almost undoubtedly not so in practice. This commit changes the semantics of `String::truncate` to be a noop if `new_len` is greater than the length of the current string. Closes #32717
2016-04-15Auto merge of #32851 - apasel422:spec-extend, r=alexcrichtonbors-0/+34
Specialize `Extend` to `append` for `{LinkedList, Vec}`
2016-04-14Auto merge of #32693 - kamalmarhubi:binary_search_by_key, r=alexcrichtonbors-0/+39
collections: Add slice::binary_search_by_key This method adds to the family of `_by_key` methods, and is the counterpart of `slice::sort_by_key`. It was mentioned on #30423 but was not implemented at that time. Refs #30423
2016-04-14Add `contains` to `VecDeque` and `LinkedList` (+ tests)Lukas Kalbertodt-0/+21
2016-04-14Specialize `Extend` to `append` for `{LinkedList, Vec}`Andrew Paseltiner-0/+34
2016-04-14fix str::split_at_mut() exampleGigih Aji Ibrahim-2/+2
2016-04-12collections: Add slice::binary_search_by_keyKamal Marhubi-0/+39
This method adds to the family of `_by_key` methods, and is the counterpart of `slice::sort_by_key`. It was mentioned on #30423 but was not implemented at that time. Refs #30423
2016-04-11std: Stabilize APIs for the 1.9 releaseAlex Crichton-25/+36
This commit applies all stabilizations, renamings, and deprecations that the library team has decided on for the upcoming 1.9 release. All tracking issues have gone through a cycle-long "final comment period" and the specific APIs stabilized/deprecated are: Stable * `std::panic` * `std::panic::catch_unwind` (renamed from `recover`) * `std::panic::resume_unwind` (renamed from `propagate`) * `std::panic::AssertUnwindSafe` (renamed from `AssertRecoverSafe`) * `std::panic::UnwindSafe` (renamed from `RecoverSafe`) * `str::is_char_boundary` * `<*const T>::as_ref` * `<*mut T>::as_ref` * `<*mut T>::as_mut` * `AsciiExt::make_ascii_uppercase` * `AsciiExt::make_ascii_lowercase` * `char::decode_utf16` * `char::DecodeUtf16` * `char::DecodeUtf16Error` * `char::DecodeUtf16Error::unpaired_surrogate` * `BTreeSet::take` * `BTreeSet::replace` * `BTreeSet::get` * `HashSet::take` * `HashSet::replace` * `HashSet::get` * `OsString::with_capacity` * `OsString::clear` * `OsString::capacity` * `OsString::reserve` * `OsString::reserve_exact` * `OsStr::is_empty` * `OsStr::len` * `std::os::unix::thread` * `RawPthread` * `JoinHandleExt` * `JoinHandleExt::as_pthread_t` * `JoinHandleExt::into_pthread_t` * `HashSet::hasher` * `HashMap::hasher` * `CommandExt::exec` * `File::try_clone` * `SocketAddr::set_ip` * `SocketAddr::set_port` * `SocketAddrV4::set_ip` * `SocketAddrV4::set_port` * `SocketAddrV6::set_ip` * `SocketAddrV6::set_port` * `SocketAddrV6::set_flowinfo` * `SocketAddrV6::set_scope_id` * `<[T]>::copy_from_slice` * `ptr::read_volatile` * `ptr::write_volatile` * The `#[deprecated]` attribute * `OpenOptions::create_new` Deprecated * `std::raw::Slice` - use raw parts of `slice` module instead * `std::raw::Repr` - use raw parts of `slice` module instead * `str::char_range_at` - use slicing plus `chars()` plus `len_utf8` * `str::char_range_at_reverse` - use slicing plus `chars().rev()` plus `len_utf8` * `str::char_at` - use slicing plus `chars()` * `str::char_at_reverse` - use slicing plus `chars().rev()` * `str::slice_shift_char` - use `chars()` plus `Chars::as_str` * `CommandExt::session_leader` - use `before_exec` instead. Closes #27719 cc #27751 (deprecating the `Slice` bits) Closes #27754 Closes #27780 Closes #27809 Closes #27811 Closes #27830 Closes #28050 Closes #29453 Closes #29791 Closes #29935 Closes #30014 Closes #30752 Closes #31262 cc #31398 (still need to deal with `before_exec`) Closes #31405 Closes #31572 Closes #31755 Closes #31756
2016-04-05Add example doc for ToOwned traitGuillaume Gomez-0/+12
2016-04-01Implement `values_mut` on `BTreeMap`.Corey Farwell-0/+60
https://github.com/rust-lang/rust/issues/32551
2016-03-31Auto merge of #32586 - seanmonstar:speialize-to-string, r=alexcrichtonbors-1/+10
specialize ToString for str If there was some conditional compiling we could do, such that this impl only exists in nightly, and is turned off in beta/stable, I think that'd be an improvement here, as we could test specialization out without affecting stable builds.
2016-03-30specialize ToString for strSean McArthur-1/+10
2016-03-30Rollup merge of #32607 - tshepang:we-gots-intoiterator, r=apasel422Steve Klabnik-1/+1
doc: no need for an explicit iter()
2016-03-30Rollup merge of #32603 - tshepang:capitalise, r=blussSteve Klabnik-1/+1
doc: first letter should be upper case
2016-03-30doc: no need for an explicit iter()Tshepang Lekhonkhobe-1/+1
2016-03-28Auto merge of #32438 - kamalmarhubi:intoiterator-example, r=steveklabnikbors-24/+24
style: Use `iter` for IntoIterator parameter names This commit standardizes the codebase on `iter` for parameters with IntoIterator bounds. Previously about 40% of IntoIterator parameters were named `iterable`, with most of the rest being named `iter`. There was a single place where it was named `iterator`.
2016-03-29doc: first letter should be upper caseTshepang Lekhonkhobe-1/+1
2016-03-28style: Use `iter` for IntoIterator parameter namesKamal Marhubi-24/+24
This commit standardizes the codebase on `iter` for parameters with IntoIterator bounds. Previously about 40% of IntoIterator parameters were named `iterable`, with most of the rest being named `iter`. There was a single place where it was named `iterator`.
2016-03-28Rollup merge of #32177 - srinivasreddy:remove_integer_suffixes, r=steveklabnikSteve Klabnik-8/+8
first round of removal of integer suffixes
2016-03-22std: Change `encode_utf{8,16}` to return iteratorsAlex Crichton-20/+5
Currently these have non-traditional APIs which take a buffer and report how much was filled in, but they're not necessarily ergonomic to use. Returning an iterator which *also* exposes an underlying slice shouldn't result in any performance loss as it's just a lazy version of the same implementation, and it's also much more ergonomic! cc #27784
2016-03-15Use issue number from rust-lang/rust, not rust-lang/rfcs.Stu Black-2/+2
2016-03-14Expose the key of Entry variants for HashMap and BTreeMap.Stu Black-0/+13
2016-03-13Call str::to_owned in String::from and uninline itUlrik Sverdrup-14/+2
String::from does not need to be inlined, it can be without it just like str::to_owned and String::clone are.
2016-03-12std: Clean out deprecated APIsAlex Crichton-85/+7
Removes all unstable and deprecated APIs prior to the 1.8 release. All APIs that are deprecated in the 1.8 release are sticking around for the rest of this cycle. Some notable changes are: * The `dynamic_lib` module was moved into `rustc_back` as the compiler still relies on a few bits and pieces. * The `DebugTuple` formatter now special-cases an empty struct name with only one field to append a trailing comma.
2016-03-12Rollup merge of #32137 - nathankleyn:improve-docs-for-binaryheap, r=steveklabnikManish Goregaokar-0/+144
Add missing documentation examples for BinaryHeap. As part of the ongoing effort to document all methods with examples, this commit adds the missing examples for the `BinaryHeap` collection type. This is part of issue #29348. r? @steveklabnik