about summary refs log tree commit diff
path: root/src/libstd/fmt/mod.rs
AgeCommit message (Collapse)AuthorLines
2014-02-20Mass rename if_ok! to try!Alex Crichton-11/+11
This "bubble up an error" macro was originally named if_ok! in order to get it landed, but after the fact it was discovered that this name is not exactly desirable. The name `if_ok!` isn't immediately clear that is has much to do with error handling, and it doesn't look fantastic in all contexts (if if_ok!(...) {}). In general, the agreed opinion about `if_ok!` is that is came in as subpar. The name `try!` is more invocative of error handling, it's shorter by 2 letters, and it looks fitting in almost all circumstances. One concern about the word `try!` is that it's too invocative of exceptions, but the belief is that this will be overcome with documentation and examples. Close #12037
2014-02-16Minor documentation fixes in std::fmtSterling Greene-3/+3
* Change '...your own time' => '...your own type' * Fix typo in the Vector2D example
2014-02-15auto merge of #12298 : alexcrichton/rust/rustdoc-testing, r=sfacklerbors-6/+6
It's too easy to forget the `rust` tag to test something. Closes #11698
2014-02-15impl fmt::Pointer for &T and &mut TCorey Richardson-1/+11
2014-02-14Fix all code examplesAlex Crichton-6/+6
2014-02-11Move replace and swap to std::mem. Get rid of std::utilEdward Wang-5/+5
Also move Void to std::any, move drop to std::mem and reexport in prelude.
2014-02-08std::fmt: convert the formatting traits to a proper self.Huon Wilson-77/+77
Poly and String have polymorphic `impl`s and so require different method names.
2014-02-04Register new snapshotsAlex Crichton-5/+0
2014-02-03Fixing remaining warnings and errors throughoutAlex Crichton-18/+9
2014-02-03std: Fixing all documentationAlex Crichton-6/+16
* Stop referencing io_error * Start changing "Failure" sections to "Error" sections * Update all doc examples to work.
2014-02-03std: Remove io::io_errorAlex Crichton-86/+92
* All I/O now returns IoResult<T> = Result<T, IoError> * All formatting traits now return fmt::Result = IoResult<()> * The if_ok!() macro was added to libstd
2014-02-02Remove the SNAP line to work around #11985.Huon Wilson-2/+2
2014-02-02std::fmt: prepare to convert the formatting traits to methods, and workHuon Wilson-0/+35
around the lack of UFCS. The further work is pending a snapshot, to avoid putting #[cfg(stage0)] attributes on all the traits and duplicating them.
2014-02-02std: rename fmt::Default to `Show`.Huon Wilson-8/+27
This is a better name with which to have a #[deriving] mode. Decision in: https://github.com/mozilla/rust/wiki/Meeting-weekly-2014-01-28
2014-02-02libextra: Remove `@str` from all the librariesPatrick Walton-1/+0
2014-01-26Removed all instances of XXX in preparation for relaxing of FIXME ruleSalem Talha-4/+4
2014-01-22Add LowerExp 'e' and UpperExp 'E' format traits/specifiersSiegeLord-0/+30
2014-01-21[std::str] Rename from_utf8_owned_opt() to from_utf8_owned(), drop the old ↵Simon Sapin-1/+1
from_utf8_owned() behavior
2014-01-21[std::str] Rename from_utf8_opt() to from_utf8(), drop the old from_utf8() ↵Simon Sapin-1/+1
behavior
2014-01-18Rename iterators for consistencyPalmer Cox-1/+1
Rename existing iterators to get rid of the Iterator suffix and to give them names that better describe the things being iterated over.
2014-01-17Tweak the interface of std::ioAlex Crichton-2/+2
* Reexport io::mem and io::buffered structs directly under io, make mem/buffered private modules * Remove with_mem_writer * Remove DEFAULT_CAPACITY and use DEFAULT_BUF_SIZE (in io::buffered)
2014-01-08Remove the io::Decorator traitAlex Crichton-2/+1
This is just an unnecessary trait that no one's ever going to parameterize over and it's more useful to just define the methods directly on the types themselves. The implementors of this type almost always don't want inner_mut_ref() but they're forced to define it as well.
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