about summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2017-02-01std: Add ToString trait specialization for Cow<'a, str> and Stringf001-0/+16
r? @bluss
2017-01-29Fix a few impl stability attributesOliver Middleton-2/+2
The versions show up in rustdoc.
2017-01-28Implement `PartialEq<&[A]>` for `VecDeque<A>`.Corey Farwell-36/+74
Fixes https://github.com/rust-lang/rust/issues/38625.
2017-01-28use `String::with_capacity` in `format!`Michał Krasnoborski-1/+2
2017-01-27Rollup merge of #39314 - stjepang:rewrite-sort-header, r=brsonAlex Crichton-2/+2
Rewrite the first sentence in slice::sort For every method, the first sentence should consisely explain what it does, not how. This sentence usually starts with a verb. It's really weird for `sort` to be explained in terms of another function, namely `sort_by`. There's no need for that because it's obvious how `sort` sorts elements: there is `T: Ord`. If `sort_by_key` does not have to explicitly state how it's implemented, then `sort` doesn't either. r? @steveklabnik
2017-01-27Rollup merge of #39307 - alexcrichton:stabilize-1.16, r=brsonAlex Crichton-30/+11
std: Stabilize APIs for the 1.16.0 release This commit applies the stabilization/deprecations of the 1.16.0 release, as tracked by the rust-lang/rust issue tracker and the final-comment-period tag. The following APIs were stabilized: * `VecDeque::truncate` * `VecDeque::resize` * `String::insert_str` * `Duration::checked_{add,sub,div,mul}` * `str::replacen` * `SocketAddr::is_ipv{4,6}` * `IpAddr::is_ipv{4,6}` * `str::repeat` * `Vec::dedup_by` * `Vec::dedup_by_key` * `Result::unwrap_or_default` * `<*const T>::wrapping_offset` * `<*mut T>::wrapping_offset` * `CommandExt::creation_flags` (on Windows) * `File::set_permissions` * `String::split_off` The following APIs were deprecated * `EnumSet` - replaced with other ecosystem abstractions, long since unstable Closes #27788 Closes #35553 Closes #35774 Closes #36436 Closes #36949 Closes #37079 Closes #37087 Closes #37516 Closes #37827 Closes #37916 Closes #37966 Closes #38080
2017-01-26Rewrite the first sentence in slice::sortStjepan Glavina-2/+2
For every method, the first sentence should consisely explain what it does, not how. This sentence usually starts with a verb. It's really weird for `sort` to be explained in terms of another function, namely `sort_by`. There's no need for that because it's obvious how `sort` sorts elements: there is `T: Ord`. If `sort_by_key` does not have to explicitly state how it's implemented, then `sort` doesn't either.
2017-01-25std: Stabilize APIs for the 1.16.0 releaseAlex Crichton-30/+11
This commit applies the stabilization/deprecations of the 1.16.0 release, as tracked by the rust-lang/rust issue tracker and the final-comment-period tag. The following APIs were stabilized: * `VecDeque::truncate` * `VecDeque::resize` * `String::insert_str` * `Duration::checked_{add,sub,div,mul}` * `str::replacen` * `SocketAddr::is_ipv{4,6}` * `IpAddr::is_ipv{4,6}` * `str::repeat` * `Vec::dedup_by` * `Vec::dedup_by_key` * `Result::unwrap_or_default` * `<*const T>::wrapping_offset` * `<*mut T>::wrapping_offset` * `CommandExt::creation_flags` (on Windows) * `File::set_permissions` * `String::split_off` The following APIs were deprecated * `EnumSet` - replaced with other ecosystem abstractions, long since unstable Closes #27788 Closes #35553 Closes #35774 Closes #36436 Closes #36949 Closes #37079 Closes #37087 Closes #37516 Closes #37827 Closes #37916 Closes #37966 Closes #38080
2017-01-25Remove trailing whitespaceStjepan Glavina-1/+1
2017-01-25Fix: insertion_len -> max_insertionStjepan Glavina-1/+1
2017-01-25Expand the sort docsStjepan Glavina-11/+33
2017-01-25Fix wording around sort guaranteesSteve Klabnik-2/+5
Fixes #38524
2017-01-20Add debug implementation for BinaryHeapPlaceGuillaume Gomez-0/+9
2017-01-20Remove Debug implementations specializationGuillaume Gomez-219/+6
2017-01-20Add Debug implementations for libcollection structsGuillaume Gomez-0/+496
2017-01-20Rollup merge of #39135 - TheCycoONE:vec_drain_doc, r=alexcrichtonAlex Crichton-2/+2
Clarify when range is removed by drain Based on a discussion on #rust-beginners the existing note for drain is confusing. This new wording was suggested.
2017-01-20Auto merge of #39062 - martinhath:placement-in-binaryheap, r=nagisabors-2/+56
Implement placement-in protocol for `BinaryHeap` Related to #30172, and loosley based on #38551. At the moment, this PR is in a pretty rough state, but I wanted to get some feedback to see if I'm going in the right direction. I hope the Mentor label of #30172 is still applicable, even though it's a year old 😄
2017-01-19Rollup merge of #39165 - frewsxcv:slice, r=GuillaumeGomezGuillaume Gomez-10/+24
A few improvements to the slice docs. * Simplify `Option::iter_mut` doc example. * Document 'empty' corner-cases for `slice::{starts_with, ends_with}`. * Indicate 'true' as code-like.
2017-01-18A few improvements to the slice docs.Corey Farwell-10/+24
* Simplify `Option::iter_mut` doc example. * Document 'empty' corner-cases for `slice::{starts_with, ends_with}`. * Indicate 'true' as code-like.
2017-01-18collections: update docs of slice get() and friendsGeorg Brandl-8/+17
for the new SliceIndex trait. Also made the docs of the unchecked versions a bit clearer; they return a reference, not an "unsafe pointer".
2017-01-17Clarify when range is removed by drainStephen E. Baker-2/+2
Based on a discussion on #rust-beginners the existing note for drain is confusing. This new wording was suggested.
2017-01-17Fix BinaryHeap place by only constructing vec::PlaceBack onceMartin Hafskjold Thoresen-45/+24
2017-01-16Rollup merge of #39106 - istankovic:patch-2, r=GuillaumeGomezGuillaume Gomez-1/+1
libcollections: btree/set: fix a typo
2017-01-16libcollections: btree/set: fix a typoIvan Stankovic-1/+1
2017-01-16libcollections: btree/map: fix typosIvan Stankovic-2/+2
2017-01-14update docs with new syntaxdjzin-9/+9
2017-01-14update docs with new syntaxdjzin-12/+18
2017-01-14fix warnings in doctestsdjzin-4/+3
2017-01-14shorten range syntaxdjzin-1/+1
2017-01-14make rangeargument methods non-default; simplify impldjzin-17/+18
2017-01-14simplify some rangesdjzin-2/+2
2017-01-14add type annotations to doctestdjzin-1/+1
2017-01-14use rangeargument for range_mutdjzin-7/+6
2017-01-14allow unsized types in `RangeArgument`djzin-1/+19
2017-01-14fix up testsdjzin-13/+17
2017-01-14change argument for btree_rangedjzin-12/+9
2017-01-14impl RangeArgument for (Bound<T>, Bound<T>)djzin-0/+18
2017-01-14have RangeArgument return a Bound<&T> from each of its methodsdjzin-18/+46
2017-01-14Add initial impl of placement-in for `BinaryHeap`Martin Hafskjold Thoresen-1/+76
2017-01-13Rollup merge of #39027 - behnam:typo, r=frewsxcvGuillaume Gomez-1/+1
[libcollections] [doc] Fix typo in documentation Replace two instances of `an raw` with `a raw` in documentation blocks.
2017-01-12[libcollections] [doc] Fix typo in documentationBehnam Esfahbod-1/+1
2017-01-13Change `to_owned` to `to_string` in docsStjepan Glavina-2/+2
We should teach conversion from `str` to `String` using `to_string` rather than the legacy `to_owned`.
2017-01-10Rollup merge of #38874 - derekdreery:patch-1, r=steveklabnikSeo Sanghyeon-1/+2
Update vec.rs Add a warning not to convert char* from c to Vec<u8> (I thought you could until I asked on irc). Reasoning is that it will help people avoid an error that could cause crashes and undefined behaviour. Only drawback is that it could confuse someone not familiar with C, but beginners are unlikely to be using this function anyway.
2017-01-10Rollup merge of #38664 - apasel422:may-dangle, r=pnkfelixSeo Sanghyeon-11/+7
Replace uses of `#[unsafe_destructor_blind_to_params]` with `#[may_dangle]` CC #34761 r? @pnkfelix
2017-01-09Auto merge of #38581 - frewsxcv:vecdequeue-insert, r=GuillaumeGomezbors-8/+12
Clarify behavior of `VecDeque::insert`. Fixes https://github.com/rust-lang/rust/issues/37046.
2017-01-08Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrcbors-1/+1
Remove not(stage0) from deny(warnings) Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2017-01-07Auto merge of #38733 - sfackler:peek-mut-pop, r=alexcrichtonbors-4/+19
Add PeekMut::pop A fairly common workflow is to put a bunch of stuff into a binary heap and then mutate the top value until its empty. This both makes that a bit more convenient (no need to save a boolean off and pop after to avoid borrowck issues), and a bit more efficient since you only shift once. r? @alexcrichton cc @rust-lang/libs
2017-01-07Auto merge of #38551 - aidanhs:aphs-vec-in-place, r=brsonbors-1/+74
Implement placement-in protocol for `Vec` Follow-up of #32366 per comment at https://github.com/rust-lang/rust/issues/30172#issuecomment-268099009, updating to latest rust, leaving @apasel422 as author and putting myself as committer. I've removed the implementation of `push` in terms of place to make this PR more conservative.
2017-01-06Update vec.rsderekdreery-1/+1
Changed language to stress char is the C meaning (u8) not unicode.
2017-01-06Update vec.rsderekdreery-1/+2
Add a warning not to convert char* from c to Vec<u8> (I thought you could until I asked on irc)