about summary refs log tree commit diff
path: root/src/libcoretest/str.rs
AgeCommit message (Collapse)AuthorLines
2015-04-05Moved coretest::str tests into collectiontest::strMarvin Löbel-375/+1
2015-04-05Refactored core::str::pattern to become a user-facing module and hide awayMarvin Löbel-4/+4
CharEq.
2015-04-01std: Changing the meaning of the count to splitnAlex Crichton-4/+4
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-03-31std: Clean out #[deprecated] APIsAlex Crichton-9/+9
This commit cleans out a large amount of deprecated APIs from the standard library and some of the facade crates as well, updating all users in the compiler and in tests as it goes along.
2015-03-23Remove auto-deref'ing Pattern impl because it conflicts with otherNiko Matsakis-2/+0
possible blanket impls and also triggers internal overflow. Add some special cases for common uses (&&str, &String) for now; bounds-targeting deref coercions are probably the right longer term answer.
2015-03-20std: Remove old_io/old_path from the preludeAlex Crichton-1/+1
This commit removes the reexports of `old_io` traits as well as `old_path` types and traits from the prelude. This functionality is now all deprecated and needs to be removed to make way for other functionality like `Seek` in the `std::io` module (currently reexported as `NewSeek` in the io prelude). Closes #23377 Closes #23378
2015-03-01remove some compiler warningsTshepang Lekhonkhobe-4/+2
2015-02-24Use arrays instead of vectors in testsVadim Petrochenkov-16/+16
2015-02-20Fix tidy and rebase falloutMarvin Löbel-2/+144
Added a few bugfixes and additional testcases
2015-02-20Added a Pattern impl that delegates to the dereference of a type.Marvin Löbel-0/+10
This allows to match with a `&String` or `&&str`, for example.
2015-02-20Refactored code into Searcher traits with naive implementationsMarvin Löbel-3/+3
Made the family of Split iterators use the Pattern API Renamed the Matcher traits into Searcher
2015-02-20Added string pattern traits and basic implementantionsMarvin Löbel-0/+7
2015-02-20Added benchmarks for string pattern matching functionsMarvin Löbel-0/+107
2015-02-04remove all kind annotations from closuresJorge Aparicio-6/+6
2015-01-30std: Stabilize FromStr and parseAlex Crichton-3/+3
This commits adds an associated type to the `FromStr` trait representing an error payload for parses which do not succeed. The previous return value, `Option<Self>` did not allow for this form of payload. After the associated type was added, the following attributes were applied: * `FromStr` is now stable * `FromStr::Err` is now stable * `FromStr::from_str` is now stable * `StrExt::parse` is now stable * `FromStr for bool` is now stable * `FromStr for $float` is now stable * `FromStr for $integral` is now stable * Errors returned from stable `FromStr` implementations are stable * Errors implement `Display` and `Error` (both impl blocks being `#[stable]`) Closes #15138
2015-01-29convert remaining `range(a, b)` to `a..b`Jorge Aparicio-1/+1
2015-01-27cleanup: s/`v.slice*()`/`&v[a..b]`/g + remove redundant `as_slice()` callsJorge Aparicio-1/+1
2015-01-03Remove deprecated functionalityAlex Crichton-6/+4
This removes a large array of deprecated functionality, regardless of how recently it was deprecated. The purpose of this commit is to clean out the standard libraries and compiler for the upcoming alpha release. Some notable compiler changes were to enable warnings for all now-deprecated command line arguments (previously the deprecated versions were silently accepted) as well as removing deriving(Zero) entirely (the trait was removed). The distribution no longer contains the libtime or libregex_macros crates. Both of these have been deprecated for some time and are available externally.
2015-01-02std: Stabilize the prelude moduleAlex Crichton-0/+2
This commit is an implementation of [RFC 503][rfc] which is a stabilization story for the prelude. Most of the RFC was directly applied, removing reexports. Some reexports are kept around, however: * `range` remains until range syntax has landed to reduce churn. * `Path` and `GenericPath` remain until path reform lands. This is done to prevent many imports of `GenericPath` which will soon be removed. * All `io` traits remain until I/O reform lands so imports can be rewritten all at once to `std::io::prelude::*`. This is a breaking change because many prelude reexports have been removed, and the RFC can be consulted for the exact list of removed reexports, as well as to find the locations of where to import them. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md [breaking-change] Closes #20068
2014-12-21Fallout of std::str stabilizationAlex Crichton-1/+1
2014-12-13libcoretest: fix fallout in unit testsJorge Aparicio-6/+6
2014-11-20Add Utf16Encoder. Generalize Utf16CodeUnits for any Iterator<char>.Simon Sapin-0/+7
This allows encoding to UTF-16 something that is not in UTF-8, e.g. a `[char]` UTF-32 string. This might help with https://github.com/servo/servo/issues/4023
2014-11-16Move FromStr to core::strBrendan Zabarauskas-0/+7
2014-10-29collections: impl Deref for Vec/StringAlex Crichton-0/+69
This commit adds the following impls: impl<T> Deref<[T]> for Vec<T> impl<T> DerefMut<[T]> for Vec<T> impl Deref<str> for String This commit also removes all duplicated inherent methods from vectors and strings as implementations will now silently call through to the slice implementation. Some breakage occurred at std and beneath due to inherent methods removed in favor of those in the slice traits and std doesn't use its own prelude, cc #18424
2014-09-02core: Make TwoWaySearcher reset its prefix memory when shifting by bytesetnham-0/+6
Closes #16878.
2014-08-20Fix TwoWaySearcher to work when used with periodic needles.nham-0/+20
There is a check in TwoWaySearcher::new to determine whether the needle is periodic. This is needed because during searching when a match fails, we cannot advance the position by the entire length of the needle when it is periodic, but can only advance by the length of the period. The reason "bananas".contains("nana") (and similar searches) were returning false was because the periodicity check was wrong. Closes #16589
2014-08-19Add a test for the fix of issue 16589nham-0/+14