summary refs log tree commit diff
path: root/src/libcollections/str.rs
AgeCommit message (Collapse)AuthorLines
2015-06-17More test fixes and fallout of stability changesAlex Crichton-4/+2
2015-06-17std: Stabilize the `str_matches` featureAlex Crichton-6/+4
This commit stabilizes the `str::{matches, rmatches}` functions and iterators, but renames the unstable feature for the `str::{matches,rmatches}_indices` function to `str_match_indices` due to the comment present on the functions about the iterator's return value.
2015-06-17Fallout in tests and docs from feature renamingsAlex Crichton-8/+8
2015-06-17collections: Split the `collections` featureAlex Crichton-10/+10
This commit also deprecates the `as_string` and `as_slice` free functions in the `string` and `vec` modules.
2015-06-11Auto merge of #26190 - Veedrac:no-iter, r=alexcrichtonbors-1/+1
Pull request for #26188.
2015-06-11Auto merge of #25839 - bluss:str-split-at-impl, r=alexcrichtonbors-45/+72
Implement RFC rust-lang/rfcs#1123 Add str method str::split_at(mid: usize) -> (&str, &str). Also a minor cleanup in the collections::str module. Remove redundant slicing of self.
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-1/+1
2015-06-10Rollup merge of #26146 - steveklabnik:remove_unsafe_pointer, r=GankroManish Goregaokar-1/+1
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-06-10collections: Remove redundant slicing for strUlrik Sverdrup-45/+45
This is a remnant from a previous implementation of the str methods. Using `self` is fine now.
2015-06-10Add str::split_atUlrik Sverdrup-0/+27
Implement RFC rust-lang/rfcs#1123 Add str method str::split_at(mid: usize) -> (&str, &str).
2015-06-10Auto merge of #26130 - steveklabnik:gh25986, r=alexcrichtonbors-3/+28
This can be confusing when whitespace is the separator Fixes #25986
2015-06-09Exise 'unsafe pointer' in favor of 'raw pointer'Steve Klabnik-1/+1
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-06-09Auto merge of #26039 - SimonSapin:case-mapping, r=alexcrichtonbors-3/+32
* Add “complex” mappings to `char::to_lowercase` and `char::to_uppercase`, making them yield sometimes more than on `char`: #25800. `str::to_lowercase` and `str::to_uppercase` are affected as well. * Add `char::to_titlecase`, since it’s the same algorithm (just different data). However this does **not** add `str::to_titlecase`, as that would require UAX#29 Unicode Text Segmentation which we decided not to include in of `std`: https://github.com/rust-lang/rfcs/pull/1054 I made `char::to_titlecase` immediately `#[stable]`, since it’s so similar to `char::to_uppercase` that’s already stable. Let me know if it should be `#[unstable]` for a while. * Add a special case for upper-case Sigma in word-final position in `str::to_lowercase`: #26035. This is the only language-independent conditional mapping currently in `SpecialCasing.txt`. * Stabilize `str::to_lowercase` and `str::to_uppercase`. The `&self -> String` on `str` signature seems straightforward enough, and the only relevant issue I’ve found is #24536 about naming. But `char` already has stable methods with the same name, and deprecating them for a rename doesn’t seem worth it. r? @alexcrichton
2015-06-09Document str::split behavior with contiguous separatorsSteve Klabnik-3/+28
This can be confusing when whitespace is the separator Fixes #25986
2015-06-08Reordered the methods on str to improve doc sortingMarkus Westerlind-673/+674
2015-06-08Address a review comment and fix a bootstrapping issueSimon Sapin-2/+7
2015-06-07Auto merge of #25912 - tshepang:better-str-examples, r=blussbors-50/+28
2015-06-07doc: improve some of str examplesTshepang Lekhonkhobe-50/+28
2015-06-06Mark str::to_uppercase and str::to_lowercase as stable.Simon Sapin-2/+2
2015-06-06Correctly map upper-case Sigma to lower-case in word-final position. Fix #26035.Simon Sapin-1/+25
2015-06-05Mark std::as_bytes as inlineJames Miller-0/+1
This wasn't marked inline, so wasn't being inlined cross-crate. It's actually a no-op function, since it's a wrapper around `mem::transmute`. Marking it inline means that programs calling it can see that it's a no-op and act accordingly during optimisation.
2015-06-01[libcollections] Fix unused import warnings during stage0 buildWesley Wiser-0/+4
2015-05-30doc: be more clear/explicit that we got String typeTshepang Lekhonkhobe-1/+1
2015-05-22Don't mention outdated methodsSteve Klabnik-3/+2
2015-05-19Small fix for https://github.com/rust-lang/rust/pull/25611Steve Klabnik-0/+4
2015-05-19doc: add missing fencesparir-0/+4
2015-05-14Add #[inline] to Borrow<str>::borrow for String.Jan Bujak-0/+1
2015-05-08collections: change bounds of SliceConcatExt implementations to use Borrow ↵Sean McArthur-6/+5
instead of AsRef
2015-05-06Auto merge of #25120 - bluss:sliceconcatext, r=alexcrichtonbors-1/+3
collections: Convert SliceConcatExt to use associated types Coherence now allows this, we have `SliceConcatExt<T> for [V] where T: Sized + Clone` and` SliceConcatExt<str> for [S]`, these don't conflict because str is never Sized.
2015-05-05collections: Convert SliceConcatExt to use associated typesUlrik Sverdrup-1/+3
Coherence now allows this, we have SliceConcatExt<T> for [V] where T: Sized + Clone and SliceConcatExt<str> for [S], these don't conflict because str is never Sized.
2015-05-04Fix spelling errors in documentation.Joseph Crail-2/+2
2015-04-21rollup merge of #24636: alexcrichton/remove-deprecatedAlex Crichton-1/+1
Conflicts: src/libcore/result.rs
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-21std: Remove deprecated AsOsStr/Str/AsSlice traitsAlex Crichton-1/+1
Cleaning out more deprecated items
2015-04-21Model lexer: Fix remaining issuesPiotr Czarnecki-2/+0
2015-04-16deprecate Unicode functions that will be moved to crates.iokwantam-9/+35
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-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-4/+4
2015-04-08Auto merge of #23293 - tbu-:pr_additive_multiplicative, r=alexcrichtonbors-2/+1
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-2/+1
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-05Refactored core::str::pattern to become a user-facing module and hide awayMarvin Löbel-2/+3
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-01std: Changing the meaning of the count to splitnAlex Crichton-11/+17
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-31Test fixes and rebase conflicts, round 3Alex Crichton-11/+13
2015-03-31rollup merge of #23901: steveklabnik/fix_links_strAlex Crichton-15/+12
Remove broken links that should just point to the current page, and while we're at it, re-wrap to 100 chars.
2015-03-31rollup merge of #23873: alexcrichton/remove-deprecatedAlex Crichton-84/+3
Conflicts: src/libcollectionstest/fmt.rs src/libcollectionstest/lib.rs src/libcollectionstest/str.rs src/libcore/error.rs src/libstd/fs.rs src/libstd/io/cursor.rs src/libstd/os.rs src/libstd/process.rs src/libtest/lib.rs src/test/run-pass-fulldeps/compiler-calls.rs
2015-03-31std: Clean out #[deprecated] APIsAlex Crichton-84/+3
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-31rollup merge of #23886: demelev/remove_as_slice_usageAlex Crichton-3/+3
2015-03-31Fixup primitive.str docsSteve Klabnik-15/+12
Remove broken links that should just point to the current page, and while we're at it, re-wrap to 100 chars.
2015-03-31Stabilize std::numAaron Turon-3/+0
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change]