summary refs log tree commit diff
path: root/src/libstd/fmt/mod.rs
AgeCommit message (Collapse)AuthorLines
2014-01-03Remove std::eitherAlex Crichton-7/+7
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-23Fixing more doc testsAlex Crichton-1/+1
2013-12-23std: Fix all code examplesAlex Crichton-15/+26
2013-12-15std: fix spelling in docs.Huon Wilson-3/+3
2013-12-11Make 'self lifetime illegal.Erik Price-14/+14
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-04std::str: s/from_utf8_slice/from_utf8/, to make the basic case shorter.Huon Wilson-1/+1
2013-11-29Removed useless cmp::{min, max} reexports from the integer modulesMarvin Löbel-1/+1
2013-11-29Removed a few macro-expanding-to-module workaroundsMarvin Löbel-22/+17
Also documented a few issues
2013-11-28Register new snapshotsAlex Crichton-1/+1
2013-11-26libstd: Remove all non-`proc` uses of `do` from libstdPatrick Walton-14/+14
2013-11-19libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstdPatrick Walton-2/+4
2013-11-11Move std::rt::io to std::ioAlex Crichton-5/+5
2013-10-23Removed unnecessary comments and white spaces as suggestedreedlepee-4/+2
2013-10-23Removed Unnecessary comments and white spaces #4386reedlepee-3/+0
2013-10-23Making fields in std and extra : private #4386reedlepee-2/+6
2013-10-21std: Move sys::log_str to repr::repr_to_str. Further work on #2240.Brian Anderson-7/+3
2013-10-19std::fmt: fix markdown peculiarity, unicodify some arrows, ` some trait names.Huon Wilson-14/+14
2013-10-18Document traits and Default about format! betterAlex Crichton-3/+48
Closes #9865 Closes #9808
2013-10-17Register new snapshotsAlex Crichton-18/+0
2013-10-15Build a few extra features into format! parsingAlex Crichton-17/+35
* Allow named parameters to specify width/precision * Intepret the format string '0$' as "width is the 0th argument" instead of thinking the lone '0' was the sign-aware-zero-padding flag. To get both you'd need to put '00$' which makes more sense if you want both to happen. Closes #9669
2013-10-01remove the `float` typeDaniel Micay-2/+0
It is simply defined as `f64` across every platform right now. A use case hasn't been presented for a `float` type defined as the highest precision floating point type implemented in hardware on the platform. Performance-wise, using the smallest precision correct for the use case greatly saves on cache space and allows for fitting more numbers into SSE/AVX registers. If there was a use case, this could be implemented as simply a type alias or a struct thanks to `#[cfg(...)]`. Closes #6592 The mailing list thread, for reference: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
2013-09-30Clarify format! implicit positional referencesAlex Crichton-19/+42
It was a little ambiguous before how explicitl positional parameters and implicit positional parameters intermingled, and this clarifies how the two intermingle. This also updates a little bit of documentation/code examples elsewhere as well.
2013-09-25rustdoc: Change all code-blocks with a scriptAlex Crichton-30/+30
find src -name '*.rs' | xargs sed -i '' 's/~~~.*{\.rust}/```rust/g' find src -name '*.rs' | xargs sed -i '' 's/ ~~~$/ ```/g' find src -name '*.rs' | xargs sed -i '' 's/^~~~$/ ```/g'
2013-09-17Document a few undocumented modules in libstdAlex Crichton-8/+9
Hopefull this will make our libstd docs appear a little more "full".
2013-09-15Document all of the format! related macrosAlex Crichton-2/+74
2013-09-15Reduce the amount of complexity in format!Alex Crichton-0/+7
This renames the syntax-extension file to format from ifmt, and it also reduces the amount of complexity inside by defining all other macros in terms of format_args!
2013-09-12Implement a format_args!() macroAlex Crichton-16/+75
The purpose of this macro is to further reduce the number of allocations which occur when dealing with formatting strings. This macro will perform all of the static analysis necessary to validate that a format string is safe, and then it will wrap up the "format string" into an opaque struct which can then be passed around. Two safe functions are added (write/format) which take this opaque argument structure, unwrap it, and then call the unsafe version of write/format (in an unsafe block). Other than these two functions, it is not intended for anyone to ever look inside this opaque struct. The macro looks a bit odd, but mostly because of rvalue lifetimes this is the only way for it to be safe that I know of. Example use-cases of this are: * third-party libraries can use the default formatting syntax without any forced allocations * the fail!() macro can avoid allocating the format string * the logging macros can avoid allocation any strings
2013-09-09rename `std::iterator` to `std::iter`Daniel Micay-1/+1
The trait will keep the `Iterator` naming, but a more concise module name makes using the free functions less verbose. The module will define iterables in addition to iterators, as it deals with iteration in general.
2013-09-05Rename str::from_bytes to str::from_utf8, closes #8985Florian Hahn-2/+2
2013-09-03Test and document escaping on format!()novalis-0/+7
2013-09-02Fix the std::fmt doc-block to show up in pandocAlex Crichton-1/+1
2013-08-27librustc: Fix merge fallout.Patrick Walton-2/+6
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-4/+11
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
2013-08-24Settle on the format/write/print family of namesAlex Crichton-26/+26
2013-08-24Remove ifmt hax and implement fprintfAlex Crichton-17/+39
2013-08-19auto merge of #8564 : alexcrichton/rust/ifmt+++, r=graydonbors-3/+53
See discussion in #8489, but this selects option 3 by adding a `Default` trait to be implemented by various basic types. Once this makes it into a snapshot I think it's about time to start overhauling all current use-cases of `fmt!` to move towards `ifmt!`. The goal is to replace `%X` with `{}` in 90% of situations, and this commit should enable that.
2013-08-16Delegate `{}` to Default instead of PolyAlex Crichton-0/+50
By using a separate trait this is overridable on a per-type basis and makes room for the possibility of even more arguments passed in for the future.
2013-08-16Implement `{:s}` for ~str and @str as wellAlex Crichton-3/+3
2013-08-16doc: correct spelling in documentation.Huon Wilson-1/+1
2013-08-15Fix a typo in the ifmt doxAlex Crichton-1/+1
2013-08-13Add `f` formats to `ifmt!`Alex Crichton-1/+33
Currently the work just the same as the old `extfmt` versions
2013-08-12Explain what ifmt! is all aboutAlex Crichton-0/+301
2013-08-12Correct the padding on integer types for formattingAlex Crichton-25/+41
2013-08-12Define integer formats for all widthsAlex Crichton-37/+56
Closes #1653
2013-08-12Implement formatting arguments for strings and integersAlex Crichton-22/+145
Closes #1651
2013-08-07Add initial support for a new formatting syntaxAlex Crichton-0/+368
The new macro is available under the name ifmt! (only an intermediate name)