about summary refs log tree commit diff
path: root/src/libstd/fmt/rt.rs
AgeCommit message (Collapse)AuthorLines
2014-05-15core: Inherit the std::fmt moduleAlex Crichton-91/+0
This commit moves all possible functionality from the standard library's string formatting utilities into the core library. This is a breaking change, due to a few tweaks in the semantics of formatting: 1. In order to break the dependency on the std::io module, a new trait, FormatWriter was introduced in core::fmt. This is the trait which is used (instead of Writer) to format data into a stream. 2. The new FormatWriter trait has one method, write(), which takes some bytes and can return an error, but the error contains very little information. The intent for this trait is for an adaptor writer to be used around the standard library's Writer trait. 3. The fmt::write{,ln,_unsafe} methods no longer take &mut io::Writer, but rather &mut FormatWriter. Since this trait is less common, all functions were removed except fmt::write, and it is not intended to be invoked directly. The main API-breaking change here is that the fmt::Formatter structure will no longer expose its `buf` field. All previous code writing directly to `f.buf` using writer methods or the `write!` macro will now instead use `f` directly. The Formatter object itself implements the `Writer` trait itself for convenience, although it does not implement the `FormatWriter` trait. The fallout of these changes will be in the following commits. [breaking-change]
2014-05-09Register new snapshotsAlex Crichton-11/+0
2014-05-08std: Extract format string parsing out of libstdAlex Crichton-3/+35
This code does not belong in libstd, and rather belongs in a dedicated crate. In the future, the syntax::ext::format module should move to the fmt_macros crate (hence the name of the crate), but for now the fmt_macros crate will only contain the format string parser. The entire fmt_macros crate is marked #[experimental] because it is not meant for general consumption, only the format!() interface is officially supported, not the internals. This is a breaking change for anyone using the internals of std::fmt::parse. Some of the flags have moved to std::fmt::rt, while the actual parsing support has all moved to the fmt_macros library. [breaking-change]
2014-03-31std: Switch field privacy as necessaryAlex Crichton-12/+12
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-2/+2
Closes #2569
2014-01-03Remove std::eitherAlex Crichton-2/+6
2013-12-11Make 'self lifetime illegal.Erik Price-13/+13
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-10-17Register new snapshotsAlex Crichton-11/+0
2013-10-15Build a few extra features into format! parsingAlex Crichton-0/+15
* 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-08-12Correct the padding on integer types for formattingAlex Crichton-1/+1
2013-08-07Add initial support for a new formatting syntaxAlex Crichton-0/+62
The new macro is available under the name ifmt! (only an intermediate name)