about summary refs log tree commit diff
path: root/src/libstd/ascii.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-213/+0
2020-04-25Bump rustfmt to most recently shippedMark Rousskov-7/+19
2019-11-29Format libstd with rustfmtDavid Tolnay-1/+1
This commit applies rustfmt with rust-lang/rust's default settings to files in src/libstd *that are not involved in any currently open PR* to minimize merge conflicts. THe list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in outstanding_files, the relevant commands were: $ find src/libstd -name '*.rs' \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ rg libstd outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of libstd. To confirm no funny business: $ git checkout $THIS_COMMIT^ $ git show --pretty= --name-only $THIS_COMMIT \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ git diff $THIS_COMMIT # there should be no difference
2018-12-25Remove licensesMark Rousskov-10/+0
2018-07-30Remove unstable and deprecated APIsSimon Sapin-310/+0
2018-07-08Update std::ascii::ASCIIExt deprecation notesKevin Zajler-10/+30
2018-03-21Deprecate the AsciiExt trait in favor of inherent methodsSimon Sapin-0/+17
The trait and some of its methods are stable and will remain. Some of the newer methods are unstable and can be removed later. Fixes https://github.com/rust-lang/rust/issues/39658
2018-03-05Remove unnecessary imports1011X-4/+0
2018-03-05Move tests, re-export items from core::ascii1011X-474/+3
2018-02-24Fixes docs for ASCII functions to no longer claim U+0021 is '@'.Nathan Ringo-1/+1
2017-12-30Fix doc typo for is_ascii_graphicvarkor-1/+1
Fixes #47067.
2017-11-29Update bootstrap compilerAlex Crichton-200/+0
Also remove a number of `stage0` annotations and such
2017-11-18Remove inherent `ascii_ctype` methods from `str` and `[u8]`Lukas Kalbertodt-43/+166
This has been discussed in #39658. It's a bit ambiguous how those methods work for a sequence of ascii values. We prefer users writing `s.iter().all(|b| b.is_ascii_...())` explicitly. The AsciiExt methods still exist and are implemented for `str` and `[u8]`. We will deprecated or remove those later.
2017-11-03Remove unused AsciiExt imports and fix tests related to ascii methodsLukas Kalbertodt-3/+5
Many AsciiExt imports have become useless thanks to the inherent ascii methods added in the last commits. These were removed. In some places, I fully specified the ascii method being called to enforce usage of the AsciiExt trait. Note that some imports are not removed but tagged with a `#[cfg(stage0)]` attribute. This is necessary, because certain ascii methods are not yet available in stage0. All those imports will be removed later. Additionally, failing tests were fixed. The test suite should exit successfully now.
2017-11-03Copy `AsciiExt` methods to `str` directlyLukas Kalbertodt-3/+13
This is done in order to deprecate AsciiExt eventually. Note that this commit contains a bunch of `cfg(stage0)` statements. This is due to a new compiler feature this commit depends on: the `slice_u8` lang item. Once this lang item is available in the stage0 compiler, all those cfg flags (and more) can be removed.
2017-11-03Copy `AsciiExt` methods to `[u8]` directlyLukas Kalbertodt-0/+10
This is done in order to deprecate AsciiExt eventually. Note that this commit contains a bunch of `cfg(stage0)` statements. This is due to a new compiler feature I am using: the `slice_u8` lang item. Once this lang item is available in the stage0 compiler, all those cfg flags (and more) can be removed.
2017-11-03Remove examples in doc-comments of `AsciiExt` methodsLukas Kalbertodt-319/+48
The doc comments were incorrect before: since the inherent ascii methods shadow the `AsciiExt` methods, the examples didn't use the `AsciiExt` at all. Since the trait will be deprecated soon anyway, the easiest solution was to remove the examples and already mention that the methods will be deprecated in the near future.
2017-11-03Use direct implementation on u8/char to implement AsciiExtLukas Kalbertodt-280/+41
The methods were copied to u8/char, so we can just use it in AsciiExt impls to avoid duplicate code.
2017-11-03Revert signature of eq_ignore_ascii_case() to originalLukas Kalbertodt-1/+1
Since the methods on u8 directly will shadow the AsciiExt methods, we cannot change the signature without breaking everything. It would have been nice to take `u8` as argument instead of `&u8`, but we cannot break stuff! So this commit reverts it to the original `&u8` version.
2017-11-03Add all methods of AsciiExt to u8 directlyLukas Kalbertodt-1/+1
This is the first step in order to deprecate AsciiExt. Since this is a WIP commit, there is still some code duplication (notably the static arrays) that will be removed later.
2017-10-20Fix most rendering warnings from switching to CommonMarksteveklabnik-1/+3
2017-04-09Reduce str transmutes, add mut versions of methods.Clar Charr-3/+2
2017-04-01Add more std::ascii module-level docs.Eugene Bulkin-0/+14
2017-04-01Clean up std::ascii sub-level docs.Eugene Bulkin-8/+44
* Change `utf8` variable names to `non_ascii` to be more clear, since ASCII and UTF-8 are compatible. * Fix `EscapeDefault` struct description to follow the typical iterator method format with a link to the generating function. * Add more `escape_default` examples to cover every case mentioned in the function description itself.
2017-03-27Fixed spelling mistakesAlan Stoate-2/+2
2017-03-26change string references in asciiext r? @steveklabnikaStoate-9/+15
2017-02-13Add feature annotations to the doctests for ascii_ctype.Zack Weinberg-0/+20
2017-02-13Squeeze URL lines under 100 chars wide to make tidy happy.Zack Weinberg-7/+7
2017-02-08Add equivalents of C's <ctype.h> functions to AsciiExt.Zack Weinberg-0/+838
* `is_ascii_alphabetic` * `is_ascii_uppercase` * `is_ascii_lowercase` * `is_ascii_alphanumeric` * `is_ascii_digit` * `is_ascii_hexdigit` * `is_ascii_punctuation` * `is_ascii_graphic` * `is_ascii_whitespace` * `is_ascii_control` This addresses issue #39658.
2017-01-29Fix a few impl stability attributesOliver Middleton-1/+1
The versions show up in rustdoc.
2017-01-22Add more references between lowercase/uppercase operations.Corey Farwell-2/+30
2016-12-18Implement `fmt::Debug` for all structures in libstd.Corey Farwell-0/+8
Part of https://github.com/rust-lang/rust/issues/31869. Also turn on the `missing_debug_implementations` lint at the crate level.
2016-08-24Use `#[prelude_import]` in `libstd`.Jeffrey Seyfried-3/+0
2016-08-18Add a FusedIterator trait.Steven Allen-0/+4
This trait can be used to avoid the overhead of a fuse wrapper when an iterator is already well-behaved. Conforming to: RFC 1581 Closes: #35602
2016-04-11std: Stabilize APIs for the 1.9 releaseAlex Crichton-6/+2
This commit applies all stabilizations, renamings, and deprecations that the library team has decided on for the upcoming 1.9 release. All tracking issues have gone through a cycle-long "final comment period" and the specific APIs stabilized/deprecated are: Stable * `std::panic` * `std::panic::catch_unwind` (renamed from `recover`) * `std::panic::resume_unwind` (renamed from `propagate`) * `std::panic::AssertUnwindSafe` (renamed from `AssertRecoverSafe`) * `std::panic::UnwindSafe` (renamed from `RecoverSafe`) * `str::is_char_boundary` * `<*const T>::as_ref` * `<*mut T>::as_ref` * `<*mut T>::as_mut` * `AsciiExt::make_ascii_uppercase` * `AsciiExt::make_ascii_lowercase` * `char::decode_utf16` * `char::DecodeUtf16` * `char::DecodeUtf16Error` * `char::DecodeUtf16Error::unpaired_surrogate` * `BTreeSet::take` * `BTreeSet::replace` * `BTreeSet::get` * `HashSet::take` * `HashSet::replace` * `HashSet::get` * `OsString::with_capacity` * `OsString::clear` * `OsString::capacity` * `OsString::reserve` * `OsString::reserve_exact` * `OsStr::is_empty` * `OsStr::len` * `std::os::unix::thread` * `RawPthread` * `JoinHandleExt` * `JoinHandleExt::as_pthread_t` * `JoinHandleExt::into_pthread_t` * `HashSet::hasher` * `HashMap::hasher` * `CommandExt::exec` * `File::try_clone` * `SocketAddr::set_ip` * `SocketAddr::set_port` * `SocketAddrV4::set_ip` * `SocketAddrV4::set_port` * `SocketAddrV6::set_ip` * `SocketAddrV6::set_port` * `SocketAddrV6::set_flowinfo` * `SocketAddrV6::set_scope_id` * `<[T]>::copy_from_slice` * `ptr::read_volatile` * `ptr::write_volatile` * The `#[deprecated]` attribute * `OpenOptions::create_new` Deprecated * `std::raw::Slice` - use raw parts of `slice` module instead * `std::raw::Repr` - use raw parts of `slice` module instead * `str::char_range_at` - use slicing plus `chars()` plus `len_utf8` * `str::char_range_at_reverse` - use slicing plus `chars().rev()` plus `len_utf8` * `str::char_at` - use slicing plus `chars()` * `str::char_at_reverse` - use slicing plus `chars().rev()` * `str::slice_shift_char` - use `chars()` plus `Chars::as_str` * `CommandExt::session_leader` - use `before_exec` instead. Closes #27719 cc #27751 (deprecating the `Slice` bits) Closes #27754 Closes #27780 Closes #27809 Closes #27811 Closes #27830 Closes #28050 Closes #29453 Closes #29791 Closes #29935 Closes #30014 Closes #30752 Closes #31262 cc #31398 (still need to deal with `before_exec`) Closes #31405 Closes #31572 Closes #31755 Closes #31756
2016-03-26Rollup merge of #32387 - alexcrichton:ascii-test, r=aturonManish Goregaokar-0/+6
std: Add regression test for #32074 Just to make sure we don't accidentally break this in the future.
2016-03-20std: Add regression test for #32074Alex Crichton-0/+6
Just to make sure we don't accidentally break this in the future.
2016-03-17std: Revert addition of `into_ascii_*` methodsAlex Crichton-102/+0
The addition of these methods in #31335 required adding impls of the trait for the `String` and `Vec<T>` types. This unfortunately caused a regression (#32074) in type inference for using these methods which the libs team has decided to not push forward with. These methods were stabilized in #32020 which was intended to get backported to beta, but the backport hasn't happened just yet. This commit reverts both the addition and stabilization of these methods. One proposed method of handling this, in #32076, was to move the methods to an extra trait to avoid conflicts with type inference. After some discussion, however, the libs team concluded that we probably want to reevaluate what we're doing here, so discussion will continue on the tracking issue, #27809.
2016-03-07Auto merge of #32051 - steveklabnik:gh9447, r=blussbors-1/+1
Fixes #9447
2016-03-04End stdlib module summaries with a full stop.Steve Klabnik-1/+1
Fixes #9447
2016-03-03std: Stabilize `into_*` ASCII methodsAlex Crichton-8/+4
These were intended to land in stable 1.8 but were just waiting for the implementation PR, so now they're landing. Specifically this PR stabilizes: * `AsciiExt::into_ascii_uppercase` * `AsciiExt::into_ascii_lowercase` * `AsciiExt for Vec<u8>` * `AsciiExt for String`
2016-03-01Auto merge of #31335 - SimonSapin:ascii-into, r=alexcrichtonbors-0/+106
The default implementations (with `where Self: Sized`) are so that methods that take `self` by value can exist in a trait that’s implemented for dynamically-sized types (`str` and `[u8]`). CC https://github.com/rust-lang/rust/issues/27809#issuecomment-177564950 CC @alexcrichton
2016-02-14Rollup merge of #31584 - tshepang:shorten, r=steveklabnikManish Goregaokar-5/+5
2016-02-11doc: assert_eq on 2 boolean values is redundantTshepang Lekhonkhobe-5/+5
2016-02-11doc: add missing wordsTshepang Lekhonkhobe-1/+1
2016-02-04Clarify scenario where AsciiExt appears to operate on non-ASCIICorey Farwell-0/+21
Fixes https://github.com/rust-lang/rust/issues/31203
2016-02-01Add AsciiExt::into_ascii_{upper,lower}caseSimon Sapin-0/+106
The default implementations (with where Self: Sized) are so that methods that take `self` by value can exist in a trait that’s implemented for dynamically-sized types (`str` and `[u8]`). CC https://github.com/rust-lang/rust/issues/27809#issuecomment-177564950
2015-08-15std: Add issues to all unstable featuresAlex Crichton-2/+2
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-85/+14
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-08-09Make `str::as_bytes_mut` privateTobias Bucher-2/+3