about summary refs log tree commit diff
path: root/src/libcore/fmt
AgeCommit message (Collapse)AuthorLines
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-2/+2
[breaking-change]
2014-05-22auto merge of #14357 : huonw/rust/spelling, r=pnkfelixbors-1/+1
The span on a inner doc-comment would point to the next token, e.g. the span for the `a` line points to the `b` line, and the span of `b` points to the `fn`. ```rust //! a //! b fn bar() {} ```
2014-05-22libcore: Remove all uses of `~str` from `libcore`.Patrick Walton-118/+120
[breaking-change]
2014-05-22Spelling/doc formatting fixes.Huon Wilson-1/+1
2014-05-18auto merge of #14258 : alexcrichton/rust/dox-format-writer, r=cmrbors-4/+32
This commit fills in the documentation holes for the FormatWriter trait which were previously accidentally left blank. Additionally, this adds the `write_fmt` method to the trait to allow usage of the `write!` macro with implementors of the `FormatWriter` trait. This is not useful for consumers of the standard library who should generally avoid the `FormatWriter` trait, but it is useful for consumers of the core library who are not using the standard library.
2014-05-17core: Document FormatWriter and allow `write!`Alex Crichton-4/+32
This commit fills in the documentation holes for the FormatWriter trait which were previously accidentally left blank. Additionally, this adds the `write_fmt` method to the trait to allow usage of the `write!` macro with implementors of the `FormatWriter` trait. This is not useful for consumers of the standard library who should generally avoid the `FormatWriter` trait, but it is useful for consumers of the core library who are not using the standard library.
2014-05-17Register new snapshotsAlex Crichton-4/+0
2014-05-15core: Update all tests for fmt movementAlex Crichton-32/+57
2014-05-15std: Fix float testsAlex Crichton-27/+1
2014-05-15core: Implement f32/f64 formattingAlex Crichton-0/+362
This is a migration of the std::{f32, f64}::to_str* functionality to the core library. This removes the growable `Vec` used in favor of a large stack buffer. The maximum base 10 exponent for f64 is 308, so a stack buffer of 512 bytes should be sufficient to store all floats.
2014-05-15core: Inherit the std::fmt moduleAlex Crichton-0/+1404
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]