about summary refs log tree commit diff
path: root/src/libstd/fmt
AgeCommit message (Collapse)AuthorLines
2013-09-30std: Remove usage of fmt!Alex Crichton-5/+6
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-12auto merge of #9140 : alexcrichton/rust/issue-9119, r=huonwbors-2/+2
Closes #9119
2013-09-12Parse underscores in identifiers for format!Alex Crichton-2/+2
Closes #9119
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-3/+2
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-04auto merge of #8944 : alexcrichton/rust/issue-8938, r=huonwbors-0/+11
Otherwise extra stuff after a lone '}' character is simply ignored, which is very bad. Closes #8938
2013-09-03Raise errors on format strings with unmatched `}`Alex Crichton-0/+11
Otherwise extra stuff after a lone '}' character is simply ignored, which is very bad. Closes #8938
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-30fix various warningsErick Tryzelaar-1/+0
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-4/+58
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-1/+55
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-2/+2
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-43/+63
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/+1326
The new macro is available under the name ifmt! (only an intermediate name)