about summary refs log tree commit diff
path: root/src/libcore/char
AgeCommit message (Collapse)AuthorLines
2020-04-23Stabilize UNICODE_VERSION (feature unicode_version)Pyfisch-3/+1
The feature will become stable in Rust 1.45. Noted that the value of UNICODE_VERSION is expected to change.
2020-04-11Store UNICODE_VERSION as a tuplePyfisch-2/+0
Remove the UnicodeVersion struct containing major, minor and update fields and replace it with a 3-tuple containing the version number. As the value of each field is limited to 255 use u8 to store them.
2020-02-11Improve `char::is_ascii_*` codeAndrea Canciani-10/+40
These methods explicitly check if a char is in a specific ASCII range, therefore the `is_ascii()` check is not needed, but LLVM seems to be unable to remove it. WARNING: this change improves the performance on ASCII `char`s, but complex checks such as `is_ascii_punctuation` become slower on non-ASCII `char`s.
2020-02-08Make the ASCII ctype inherent methods constDylan MacKenzie-10/+20
2020-01-14Replace old tables with new unicode dataMark Rousskov-10/+10
2019-12-23Minimize unsafety in encode_utf8Mark Rousskov-30/+29
Use slice patterns to avoid having to skip bounds checking
2019-12-21Require issue = "none" over issue = "0" in unstable attributesRoss MacArthur-1/+1
2019-12-18Propagate cfg bootstrapMark Rousskov-4/+1
2019-12-13Require stable/unstable annotations for the constness of all stable ↵Oliver Scherer-0/+4
functions with a `const` modifier
2019-12-11Some small readability improvementsAndre Bogus-10/+5
2019-11-26Format libcore with rustfmtDavid Tolnay-83/+57
This commit applies rustfmt with default settings to files in src/libcore *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/libcore -name '*.rs' | xargs rustfmt --edition=2018 $ rg libcore outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of libcore.
2019-11-06Have tidy ensure that we document all `unsafe` blocks in libcoreOliver Scherer-1/+5
2019-10-12Improve docs on some char boolean methodsBO41-63/+109
2019-10-01Remove unneeded `fn main` blocks from docsLzu Tao-34/+32
2019-09-04remove XID and Pattern_White_Space unicode tables from libcoreAleksey Kladov-23/+0
They are only used by rustc_lexer, and are not needed elsewhere. So we move the relevant definitions into rustc_lexer (while the actual unicode data comes from the unicode-xid crate) and make the rest of the compiler use it.
2019-08-14Handle cfg(bootstrap) throughoutMark Rousskov-12/+2
2019-07-25Fix inconsistent highlight blocks.Tomasz Różański-7/+7
2019-07-22add rustc_private as a proper language feature gateAleksey Kladov-7/+12
At the moment, `rustc_private` as a (library) feature exists by accident: `char::is_xid_start`, `char::is_xid_continue` methods in libcore define it.
2019-06-30fix the same typo in doctestlcolaholicl-2/+2
2019-06-30Fix a typolcolaholicl-1/+1
Fix a typo in `libcore/char/methods.rs`
2019-06-14Change `...` to `..=` where applicableAaron Kutch-18/+18
2019-04-19libcore: deny more...Mazdak Farrokhzad-10/+9
2019-04-18libcore => 2018Taiki Endo-13/+16
2019-03-19Rollup merge of #58778 - xfix:exact_size_case_mapping_iter, r=SimonSapinMazdak Farrokhzad-0/+22
Implement ExactSizeIterator for ToLowercase and ToUppercase
2019-03-19Update since annotation for ExactSizeIterator for ToUppercase/LowercaseKonrad Borowski-2/+2
This functionality was added in 1.35.0, not 1.34.0.
2019-02-27Implement ExactSizeIterator for ToLowercase and ToUppercaseKonrad Borowski-0/+22
2019-02-13Stabilize TryFrom and TryIntoSimon Sapin-4/+4
2019-02-12Auto merge of #58051 - SimonSapin:str_escape, r=alexcrichtonbors-3/+1
Stabilize str::escape_* methods with new return types… … that implement `Display` and `Iterator<Item=char>`, as proposed in FCP: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-12Make the prema-unstable char::escape_debug_ext method crate-privateSimon Sapin-3/+1
2019-02-10libs: doc commentsAlexander Regueiro-11/+11
2018-12-25Remove licensesMark Rousskov-40/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-11-21update various stdlib docsSteve Klabnik-4/+2
2018-11-14core/char: Add comment to `to_digit()`Tobias Bieniek-0/+3
2018-11-14core/char: Drop `radix == 10` special caseTobias Bieniek-8/+1
This seems to perform equally well
2018-11-13core/char: Speed up `to_digit()` for `radix <= 10`Tobias Bieniek-5/+20
### Before ``` # Run 1 test char::methods::bench_to_digit_radix_10 ... bench: 16,265 ns/iter (+/- 1,774) test char::methods::bench_to_digit_radix_16 ... bench: 13,938 ns/iter (+/- 2,479) test char::methods::bench_to_digit_radix_2 ... bench: 13,090 ns/iter (+/- 524) test char::methods::bench_to_digit_radix_36 ... bench: 14,236 ns/iter (+/- 1,949) # Run 2 test char::methods::bench_to_digit_radix_10 ... bench: 16,176 ns/iter (+/- 1,589) test char::methods::bench_to_digit_radix_16 ... bench: 13,896 ns/iter (+/- 3,140) test char::methods::bench_to_digit_radix_2 ... bench: 13,158 ns/iter (+/- 1,112) test char::methods::bench_to_digit_radix_36 ... bench: 14,206 ns/iter (+/- 1,312) # Run 3 test char::methods::bench_to_digit_radix_10 ... bench: 16,221 ns/iter (+/- 2,423) test char::methods::bench_to_digit_radix_16 ... bench: 14,361 ns/iter (+/- 3,926) test char::methods::bench_to_digit_radix_2 ... bench: 13,097 ns/iter (+/- 671) test char::methods::bench_to_digit_radix_36 ... bench: 14,388 ns/iter (+/- 1,068) ``` ### After ``` # Run 1 test char::methods::bench_to_digit_radix_10 ... bench: 11,521 ns/iter (+/- 552) test char::methods::bench_to_digit_radix_16 ... bench: 12,926 ns/iter (+/- 684) test char::methods::bench_to_digit_radix_2 ... bench: 11,266 ns/iter (+/- 1,085) test char::methods::bench_to_digit_radix_36 ... bench: 14,213 ns/iter (+/- 614) # Run 2 test char::methods::bench_to_digit_radix_10 ... bench: 11,424 ns/iter (+/- 1,042) test char::methods::bench_to_digit_radix_16 ... bench: 12,854 ns/iter (+/- 1,193) test char::methods::bench_to_digit_radix_2 ... bench: 11,193 ns/iter (+/- 716) test char::methods::bench_to_digit_radix_36 ... bench: 14,249 ns/iter (+/- 3,514) # Run 3 test char::methods::bench_to_digit_radix_10 ... bench: 11,469 ns/iter (+/- 685) test char::methods::bench_to_digit_radix_16 ... bench: 12,852 ns/iter (+/- 568) test char::methods::bench_to_digit_radix_2 ... bench: 11,275 ns/iter (+/- 1,356) test char::methods::bench_to_digit_radix_36 ... bench: 14,188 ns/iter (+/- 1,501) ```
2018-11-13core/char: Replace condition + `panic!()` with `assert!()`Tobias Bieniek-3/+1
2018-11-10reduce list to functions callable in const ctx.Mazdak Farrokhzad-1/+1
2018-11-10constify parts of libcore.Mazdak Farrokhzad-2/+2
2018-09-25Add examples for docSon-4/+22
2018-08-20Add doc for impl From in char_convertSon-0/+8
2018-08-12Rollup merge of #53059 - ljedrz:unneeded_returns, r=kennytmGuillaume Gomez-2/+2
Remove explicit returns where unnecessary
2018-08-05Correct invalid feature attributesvarkor-20/+0
2018-08-04Remove explicit returns where unnecessaryljedrz-2/+2
2018-08-01Auto merge of #51609 - dscorbett:is_numeric, r=alexcrichtonbors-4/+4
Treat gc=No characters as numeric [`char::is_numeric`](https://doc.rust-lang.org/std/primitive.char.html#method.is_numeric) and [`char::is_alphanumeric`](https://doc.rust-lang.org/std/primitive.char.html#method.is_alphanumeric) are documented to be defined “in terms of the Unicode General Categories 'Nd', 'Nl', 'No'”, but unicode.py does not group 'No' with the other 'N' categories. These functions therefore currently return `false` for characters like ⟨¾⟩ and ⟨①⟩.
2018-07-30Remove unstable and deprecated APIsSimon Sapin-132/+0
2018-06-26migrate codebase to `..=` inclusive range patternsZack M. Davis-18/+18
These were stabilized in March 2018's #47813, and are the Preferred Way to Do It going forward (q.v. #51043).
2018-06-17Treat gc=No characters as numericDavid Corbett-4/+4
2018-05-30mod.rs isn't beautifuluuttff8-4/+4
2018-05-21Only escape extended grapheme characters in the first positionvarkor-12/+22