about summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2015-04-25Auto merge of #24783 - jooert:unittestguidelines, r=alexcrichtonbors-2/+2
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest (see #23870, #24030 and http://users.rust-lang.org/t/guidelines-naming-of-unit-test-module/1078 for previous discussions). r? @alexcrichton
2015-04-24Whoops, please tidySteve Klabnik-9/+9
2015-04-24Add examples by @pnkfelix to fmt precisionSteve Klabnik-5/+62
Fixes #24656
2015-04-24Change name of unit test sub-module to "tests".Johannes Oertel-2/+2
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest.
2015-04-21Test fixes and rebase conflicts, round 1Alex Crichton-2/+1
2015-04-21rollup merge of #24636: alexcrichton/remove-deprecatedAlex Crichton-36/+6
Conflicts: src/libcore/result.rs
2015-04-21rollup merge of #24541: alexcrichton/issue-24538Alex Crichton-175/+133
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-21std: Bring back f32::from_str_radix as an unstable APIAlex Crichton-5/+4
This API was exercised in a few tests and mirrors the `from_str_radix` functionality of the integer types.
2015-04-21rollup merge of #24661: SimonSapin/fmt-write-charAlex Crichton-0/+6
as accepted in [RFC 526](https://github.com/rust-lang/rfcs/blob/master/text/0526-fmt-text-writer.md). Note that this brand new method is marked as **stable**. I judged this safe enough: it’s simple enough that it’s very unlikely to change. Still, I can mark it unstable instead if you prefer. r? @alexcrichton
2015-04-21rollup merge of #24651: tamird/old-referencesAlex Crichton-2/+0
r? @alexcrichton
2015-04-21implement rfc 1054: split_whitespace() fn, deprecate words()kwantam-6/+23
For now, words() is left in (but deprecated), and Words is a type alias for struct SplitWhitespace. Also cleaned up references to s.words() throughout codebase. Closes #15628
2015-04-21unstabilize Words structkwantam-0/+1
Words struct was stabilied by mistake. Unstabilize.
2015-04-21std: Remove deprecated/unstable num functionalityAlex Crichton-8/+0
This commit removes all the old casting/generic traits from `std::num` that are no longer in use by the standard library. This additionally removes the old `strconv` module which has not seen much use in quite a long time. All generic functionality has been supplanted with traits in the `num` crate and the `strconv` module is supplanted with the [rust-strconv crate][rust-strconv]. [rust-strconv]: https://github.com/lifthrasiir/rust-strconv This is a breaking change due to the removal of these deprecated crates, and the alternative crates are listed above. [breaking-change]
2015-04-21std: Remove deprecated AsOsStr/Str/AsSlice traitsAlex Crichton-23/+2
Cleaning out more deprecated items
2015-04-21Remove references to `old_{path,io}`Tamir Duberstein-2/+0
2015-04-21Auto merge of #24620 - pczarn:model-lexer-issues, r=cmrbors-6/+0
Fixes #15679 Fixes #15878 Fixes #15882 Closes #15883
2015-04-21Add a `write_char` method to `std::fmt::Write`Simon Sapin-0/+6
as accepted in [RFC 526](https://github.com/rust-lang/rfcs/blob/master/text/0526-fmt-text-writer.md).
2015-04-21Model lexer: Fix remaining issuesPiotr Czarnecki-6/+0
2015-04-20Update reference to old_io in fmt docsMatt Brubeck-1/+1
2015-04-19Auto merge of #24517 - erickt:str, r=alexcrichtonbors-1/+12
This implementation is currently about 3-4 times faster than using the `.to_string()` based approach. I would also suggest we deprecate `String::from_str` since it's redundant with the stable `String::from` method, but I'll leave that for a future PR.
2015-04-19collections: Move optimized String::from_str to String::fromErick Tryzelaar-1/+12
This implementation is currently about 3-4 times faster than using the `.to_string()` based approach.
2015-04-18Utilize if..let for get_mut doc-comment examplesCorey Farwell-14/+8
2015-04-18Auto merge of #24519 - rprichard:opt-write-args, r=alexcrichtonbors-1/+1
It's just as convenient, but it's much faster. Using write! requires an extra call to fmt::write and a extra dynamically dispatched call to Arguments' Display format function.
2015-04-17std: Add Default/IntoIterator/ToOwned to the preludeAlex Crichton-175/+133
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-16Call write_fmt directly to format an Arguments value.Ryan Prichard-1/+1
It's just as convenient, but it's much faster. Using write! requires an extra call to fmt::write and a extra dynamically dispatched call to Arguments' Display format function.
2015-04-16deprecate Unicode functions that will be moved to crates.iokwantam-12/+38
This patch 1. renames libunicode to librustc_unicode, 2. deprecates several pieces of libunicode (see below), and 3. removes references to deprecated functions from librustc_driver and libsyntax. This may change pretty-printed output from these modules in cases involving wide or combining characters used in filenames, identifiers, etc. The following functions are marked deprecated: 1. char.width() and str.width(): --> use unicode-width crate 2. str.graphemes() and str.grapheme_indices(): --> use unicode-segmentation crate 3. str.nfd_chars(), str.nfkd_chars(), str.nfc_chars(), str.nfkc_chars(), char.compose(), char.decompose_canonical(), char.decompose_compatible(), char.canonical_combining_class(): --> use unicode-normalization crate
2015-04-14Fill in missing implementationTamir Duberstein-0/+3
2015-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-1/+1
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-2/+2
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-14rollup merge of #24377: apasel422/docsAlex Crichton-26/+26
Conflicts: src/libstd/net/ip.rs src/libstd/sys/unix/fs.rs src/libstd/sys/unix/mod.rs src/libstd/sys/windows/mod.rs
2015-04-14rollup merge of #24310: alexcrichton/stabilize-utf8-errorAlex Crichton-10/+7
The meaning of each variant of this enum was somewhat ambiguous and it's uncler that we wouldn't even want to add more enumeration values in the future. As a result this error has been altered to instead become an opaque structure. Learning about the "first invalid byte index" is still an unstable feature, but the type itself is now stable.
2015-04-14test: Fixup many library unit testsAlex Crichton-2/+2
2015-04-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-26/+26
2015-04-13Auto merge of #23849 - bcoopers:master, r=pnkfelixbors-6/+18
Right now, if the user requests to increase the vector size via reserve() or push_back() and the request brings the attempted memory above usize::MAX, we panic. With this change there is only a panic if the minimum requested memory that could meet the requirement is above usize::MAX- otherwise it simply requests its largest capacity possible, usize::MAX.
2015-04-12The panic! macro can't be called with a variable declaredbcoopers-3/+3
with "let" when building on stage0. So change the error message to a static const.
2015-04-11Rollup merge of #24304 - ihrwein:fix-some-typos, r=alexcrichtonManish Goregaokar-2/+2
Signed-off-by: Tibor Benke <ihrwein@gmail.com>
2015-04-11Rollup merge of #24279 - libfud:vec_insertion_docs, r=steveklabnikManish Goregaokar-2/+1
...to be less confusing. Since 0 is the smallest number possible for usize, it doesn't make sense to mention it if it's already included, and it should be more clear that the length of the vector is a valid index with the new wording. r? @steveklabnik
2015-04-10std: Stabilize the Utf8Error typeAlex Crichton-10/+7
The meaning of each variant of this enum was somewhat ambiguous and it's uncler that we wouldn't even want to add more enumeration values in the future. As a result this error has been altered to instead become an opaque structure. Learning about the "first invalid byte index" is still an unstable feature, but the type itself is now stable.
2015-04-10Fix some typosTibor Benke-2/+2
Signed-off-by: Tibor Benke <ihrwein@gmail.com>
2015-04-10Changed the wording of the documentation for the insert method for Vec to be ↵Dominick Allen-2/+1
less confusing. Since 0 is the smallest number possible for usize, it doesn't make sense to mention it if it's already included, and it should be more clear that the length of the vector is a valid index with the new wording.
2015-04-09Fix `borrow` docsAndrew Paseltiner-9/+9
2015-04-08Auto merge of #23293 - tbu-:pr_additive_multiplicative, r=alexcrichtonbors-4/+2
Previously it could not be implemented for types outside `libcore/iter.rs` due to coherence issues.
2015-04-08Make `sum` and `product` inherent methods on `Iterator`Tobias Bucher-4/+2
In addition to being nicer, this also allows you to use `sum` and `product` for iterators yielding custom types aside from the standard integers. Due to removing the `AdditiveIterator` and `MultiplicativeIterator` trait, this is a breaking change. [breaking-change]
2015-04-07Auto merge of #23952 - Kimundi:more_string_pattern, r=alexcrichtonbors-97/+393
This adds the missing methods and turns `str::pattern` in a user facing module, as per RFC. This also contains some big internal refactorings: - string iterator pairs are implemented with a central macro to reduce redundancy - Moved all tests from `coretest::str` into `collectionstest::str` and left a note to prevent the two sets of tests drifting apart further. See https://github.com/rust-lang/rust/issues/22477
2015-04-05Refactored core::str::pattern to become a user-facing module and hide awayMarvin Löbel-3/+4
CharEq.
2015-04-05Format all str docs to 80 char line breaksMarvin Löbel-109/+174
2015-04-05Implemented remaining string pattern iterators.Marvin Löbel-45/+275
- Added missing reverse versions of methods - Added [r]matches() - Generated the string pattern iterators with a macro - Added where bounds to the methods returning reverse iterators for better error messages.
2015-04-04Rollup merge of #24012 - tsion:patch-1, r=steveklabnikManish Goregaokar-1/+1
This was brought up in IRC by a confused reader. r? steveklabnik
2015-04-04Rollup merge of #23995 - aturon:cow-as-ref, r=huonwManish Goregaokar-1/+1
The existing impl had the too-strong requirement of `Clone`, when only `ToOwned` was needed.
2015-04-03Auto merge of #23972 - gkoz:partial_eq_str_string, r=alexcrichtonbors-10/+12
Right now comparing a `&String` (or a `&Cow`) to a `&str` requires redundant borrowing of the latter. Implementing `PartialEq<str>` tries to avoid this limitation. ```rust struct Foo (String); fn main () { let s = Foo("foo".to_string()); match s { Foo(ref x) if x == &"foo" => println!("foo!"), // avoid this -----^ _ => {} } } ``` I was hoping that #23521 would solve this but it didn't work out.