about summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
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-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-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.
2015-04-03Remove unnecessary `Vec<_>` annotation from docsScott Olson-1/+1
This was brought up in IRC by a confused reader.
2015-04-02Adjust `AsRef` impl for `Cow`Aaron Turon-1/+1
The existing impl had the too-strong requirement of `Clone`, when only `ToOwned` was needed.
2015-04-03Auto merge of #23832 - petrochenkov:usize, r=aturonbors-18/+18
These constants are small and can fit even in `u8`, but semantically they have type `usize` because they denote sizes and are almost always used in `usize` context. The change of their type to `u32` during the integer audit led only to the large amount of `as usize` noise (see the second commit, which removes this noise). This is a minor [breaking-change] to an unstable interface. r? @aturon
2015-04-02Implement PartialEq<str> for String and CowGleb Kozyrev-0/+2
2015-04-02Change PartialEq impls in collections::string to slice notationGleb Kozyrev-10/+10
2015-04-02Auto merge of #23868 - mbrubeck:doc-edit, r=Manishearth 1.0.0-betabors-6/+6
r? @steveklabnik
2015-04-01rollup merge of #23860: nikomatsakis/copy-requires-cloneAlex Crichton-3/+7
Conflicts: src/test/compile-fail/coherence-impls-copy.rs
2015-04-01rollup merge of #23945: pnkfelix/gate-u-negateAlex Crichton-1/+1
Feature-gate unsigned unary negate. Discussed in weekly meeting here: https://github.com/rust-lang/meeting-minutes/blob/master/weekly-meetings/2015-03-31.md#feature-gate--expr and also in the internals thread here: http://internals.rust-lang.org/t/forbid-unsigned-integer/752
2015-04-01fallout from feature-gating unary negation on unsigned integers.Felix S. Klock II-1/+1
2015-04-01rollup merge of #23951: alexcrichton/splitnAlex Crichton-17/+35
This commit is an implementation of [RFC 979][rfc] which changes the meaning of the count parameter to the `splitn` function on strings and slices. The parameter now means the number of items that are returned from the iterator, not the number of splits that are made. [rfc]: https://github.com/rust-lang/rfcs/pull/979 Closes #23911 [breaking-change]
2015-04-01std: Changing the meaning of the count to splitnAlex Crichton-17/+35
This commit is an implementation of [RFC 979][rfc] which changes the meaning of the count parameter to the `splitn` function on strings and slices. The parameter now means the number of items that are returned from the iterator, not the number of splits that are made. [rfc]: https://github.com/rust-lang/rfcs/pull/979 Closes #23911 [breaking-change]