summary refs log tree commit diff
path: root/src/libstd/char.rs
AgeCommit message (Collapse)AuthorLines
2014-03-25libstd: Document the following modules:Patrick Walton-3/+137
* native::io * std::char * std::fmt * std::fmt::parse * std::io * std::io::extensions * std::io::net::ip * std::io::net::udp * std::io::net::unix * std::io::pipe * std::num * std::num::f32 * std::num::f64 * std::num::strconv * std::os
2014-03-13Remove code duplicationPiotr Zolnierek-4/+10
Remove whitespace Update documentation for to_uppercase, to_lowercase
2014-03-13Implement lower, upper case conversion for charPiotr Zolnierek-1/+66
2014-03-08doc: add two missing char methods doc-stringsLuca Bruno-2/+12
XID_* property are defined in UAX #31, just reference it here. Signed-off-by: Luca Bruno <lucab@debian.org>
2014-03-08doc: uniform std::char doc-stringsLuca Bruno-23/+30
Uniform and beautify doc-string for current rustdoc output. Signed-off-by: Luca Bruno <lucab@debian.org>
2014-03-08doc: don't refer to 'char' as charactersLuca Bruno-18/+32
This seems to be causing some confusion among users. Rust's char are not 8bit characters, but 32bit UCS-4 codepoint without surrogates (Unicode Scalar Values as per Unicode glossary). Make the doc more explicit about it. Signed-off-by: Luca Bruno <lucab@debian.org>
2014-02-23Remove all ToStr impls, add Show implsAlex Crichton-9/+1
This commit changes the ToStr trait to: impl<T: fmt::Show> ToStr for T { fn to_str(&self) -> ~str { format!("{}", *self) } } The ToStr trait has been on the chopping block for quite awhile now, and this is the final nail in its coffin. The trait and the corresponding method are not being removed as part of this commit, but rather any implementations of the `ToStr` trait are being forbidden because of the generic impl. The new way to get the `to_str()` method to work is to implement `fmt::Show`. Formatting into a `&mut Writer` (as `format!` does) is much more efficient than `ToStr` when building up large strings. The `ToStr` trait forces many intermediate allocations to be made while the `fmt::Show` trait allows incremental buildup in the same heap allocated buffer. Additionally, the `fmt::Show` trait is much more extensible in terms of interoperation with other `Writer` instances and in more situations. By design the `ToStr` trait requires at least one allocation whereas the `fmt::Show` trait does not require any allocations. Closes #8242 Closes #9806
2014-02-23std: mark two helper functions #[inline].Huon Wilson-0/+1
`str::utf8_char_width` and `char::from_u32` are tiny, which means it's a big performance hit to call them in a tight loop outside libstd.
2014-01-20Add operator trait constraints to std::num::{Zero, One} and document their ↵Brendan Zabarauskas-10/+0
appropriate use Zero and One have precise definitions in mathematics. Documentation has been added to describe the appropriate uses for these traits and the laws that they should satisfy. For more information regarding these identities, see the following wikipedia pages: - http://wikipedia.org/wiki/Additive_identity - http://wikipedia.org/wiki/Multiplicative_identity
2013-12-27std: uniform modules titles for docLuca Bruno-1/+1
This commit uniforms the short title of modules provided by libstd, in order to make their roles more explicit when glancing at the index. Signed-off-by: Luca Bruno <lucab@debian.org>
2013-12-15std: fix spelling in docs.Huon Wilson-2/+2
2013-11-27Fix handling of upper/lowercase, and whitespaceFlorian Zeitz-10/+8
2013-11-26test: Remove non-procedure uses of `do` from compiletest, libstd tests,Patrick Walton-2/+2
compile-fail tests, run-fail tests, and run-pass tests.
2013-11-19libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstdPatrick Walton-9/+9
2013-11-01Fix typo in to_digitGyorgy Andrasek-1/+1
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-3/+3
Who doesn't like a massive renaming?
2013-09-30std: Remove usage of fmt!Alex Crichton-3/+3
2013-09-23Added is_control function, method, and tests.Jesse Ray-0/+24
2013-09-18Remove and replace cond! Closes #9282.Jimmy Zelinskie-12/+12
2013-09-15Use std::iter::range_stepblake2-ppc-4/+3
Use the iterator version instead of the old uint::/int::range_step functions.
2013-09-12std: Add a bunch of Default implsErick Tryzelaar-0/+10
2013-09-04stop treating char as an integer typeDaniel Micay-17/+37
Closes #7609
2013-09-04Added ToStr impl for charMarvin Löbel-0/+15
Changed ToStr impl for Ascii
2013-08-30remove several 'ne' methodsEric Martin-2/+0
2013-08-21Add Unicode decomposition mappings to std::unicodeFlorian Zeitz-1/+46
2013-08-12Implement formatting arguments for strings and integersAlex Crichton-0/+38
Closes #1651
2013-08-09Remove redundant Ord method impls.OGINO Masanori-6/+0
Basically, generic containers should not use the default methods since a type of elements may not guarantees total order. str could use them since u8's Ord guarantees total order. Floating point numbers are also broken with the default methods because of NaN. Thanks for @thestinger. Timespec also guarantees total order AIUI. I'm unsure whether extra::semver::Identifier does so I left it alone. Proof needed. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-08-03replace all remaining `for` with `foreach` or `do`Daniel Micay-2/+3
2013-07-06Faster check for ascii-spaceGary Linscott-1/+2
Since ' ' is by far one of the most common characters, it is worthwhile to put it first, and short-circuit the rest of the function. On the same JSON benchmark, as the json_perf improvement, reading example.json 10 times from https://code.google.com/p/rapidjson/wiki/Performance. Before: 0.16s After: 0.11s
2013-06-30Specialize to_str_common for floats/integers in strconvAlex Crichton-1/+1
This allows the integral paths to avoid allocations on the heap Closes #4424, #4423
2013-06-30Change char::escape_{default,unicode} to take callbacks instead of allocatingAlex Crichton-49/+58
strings
2013-06-28Rewrite each_path to allow performance improvements in the future.Patrick Walton-0/+1
Instead of determining paths from the path tag, we iterate through modules' children recursively in the metadata. This will allow for lazy external module resolution.
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-12/+12
2013-06-14Add Zero impls for lots of common typesAlex Crichton-2/+8
2013-05-30Require documentation by default for libstdAlex Crichton-0/+5
Adds documentation for various things that I understand. Adds #[allow(missing_doc)] for lots of things that I don't understand.
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-0/+406
This only changes the directory names; it does not change the "real" metadata names.
2011-12-14Remove some duplicated unused parts of std now that they're present in core.Graydon Hoare-150/+0
2011-12-07Change literal representation to not truncateMarijn Haverbeke-5/+18
Also shuffles around the organization of numeric literals and types, separating by int/uint/float instead of machine-vs-non-machine types. This simplifies some code. Closes #974 Closes #1252
2011-12-06Establish 'core' library separate from 'std'.Graydon Hoare-0/+137