about summary refs log tree commit diff
path: root/src/libcore/fmt
AgeCommit message (Collapse)AuthorLines
2019-03-26adjust MaybeUninit API to discussionsRalf Jung-10/+10
uninitialized -> uninit into_initialized -> assume_init read_initialized -> read set -> write
2019-02-22avoid unnecessary use of MaybeUninit::get_ref, and expand comment on the othersRalf Jung-0/+4
2019-02-20Rollup merge of #58538 - GuillaumeGomez:fmt-examples, r=Centrilkennytm-10/+313
Add missing fmt structs examples r? @rust-lang/docs
2019-02-19Add missing fmt structs examplesGuillaume Gomez-10/+313
2019-02-13Rollup merge of #58272 - fitzgen:num-format-code-size, r=Mark-SimulacrumMazdak Farrokhzad-74/+114
Cut down on number formating code size r? @alexcrichton
2019-02-10libs: doc commentsAlexander Regueiro-2/+2
2019-02-08Use write_char for writing padding charactersNick Fitzgerald-22/+8
Removes some unsafe *and* saves almost half a kilobyte of code size.
2019-02-08Also de-duplicate 32- and 64-bit number formatting on wasm32Nick Fitzgerald-8/+18
2019-02-07Un-monomorphize and inline formatting with paddingNick Fitzgerald-29/+57
The generic `F` in `with_padding` was causing a bunch of stuff to get inlined that otherwise needn't be, blowing up code size.
2019-02-07De-duplicate write_prefix lambda in pad_integralNick Fitzgerald-11/+20
For smaller code size.
2019-02-07De-duplicate number formatting implementations for smaller code sizeNick Fitzgerald-31/+38
Instead of inlining the same logic into every number formatting implementation, pull it out into a function that each of the number formatting impls call into.
2019-01-28rename first_mut_ptr -> first_ptr_mutRalf Jung-1/+1
2019-01-28add macro for creating uninitialized arrayRalf Jung-12/+2
2019-01-28libcore: avoid mem::uninitialized and raw ptr castsRalf Jung-7/+21
2019-01-28libcore: remove unneeded allow(deprecated)Ralf Jung-3/+1
2019-01-22Rollup merge of #57537 - sinkuu:fmt_perf, r=alexcrichtonMazdak Farrokhzad-4/+6
Small perf improvement for fmt Added benchmark is based on #10761
2019-01-19Rollup merge of #57452 - steveklabnik:improve-formatter-docs, r=frewsxcvMazdak Farrokhzad-3/+12
Improve docs for Formatter Some improvements to `std::fmt::Formatter` to make it a bit more consistent with other documentation, as well as calling out that you don't ever instantiate one yourself.
2019-01-12Utilize specialized zip iterator implShotaro Yamada-4/+6
name old ns/iter new ns/iter diff ns/iter diff % speedup fmt::write_str_macro1 13,927 12,489 -1,438 -10.33% x 1.12 fmt::write_str_macro2 24,633 23,418 -1,215 -4.93% x 1.05 fmt::write_str_macro_debug 234,633 233,092 -1,541 -0.66% x 1.01 fmt::write_str_ref 5,819 5,823 4 0.07% x 1.00 fmt::write_str_value 6,012 5,828 -184 -3.06% x 1.03 fmt::write_vec_macro1 18,550 17,143 -1,407 -7.58% x 1.08 fmt::write_vec_macro2 30,369 28,920 -1,449 -4.77% x 1.05 fmt::write_vec_macro_debug 244,338 244,901 563 0.23% x 1.00 fmt::write_vec_ref 5,952 5,885 -67 -1.13% x 1.01 fmt::write_vec_value 5,944 5,894 -50 -0.84% x 1.01
2019-01-09Improve docs for FormatterSteve Klabnik-3/+12
2019-01-09Misc cleanupsShotaro Yamada-6/+6
2019-01-06Derive Clone for ArgumentV1Shotaro Yamada-9/+1
manual impl was a workaround for #28229.
2019-01-06Remove unnecessary adapterShotaro Yamada-23/+2
2018-12-25Remove licensesMark Rousskov-50/+0
2018-12-13Wording changesEsteban Küber-3/+3
2018-12-12Suggest using `.display()` when trying to print a `Path`Esteban Küber-2/+7
2018-12-04cleanup: remove static lifetimes from constsljedrz-1/+1
2018-12-02let FIXME refer to tracking issueRalf Jung-1/+1
2018-11-27add comments explaining our uses of get_ref/get_mut for MaybeUninitRalf Jung-0/+3
2018-11-23use MaybeUninit in core::fmtRalf Jung-13/+14
Code by @japaric, I just split it into individual commits
2018-10-13doc: make core::fmt::Error example more simpleTshepang Lekhonkhobe-3/+2
2018-09-29Use impl_header_lifetime_elision in libcoreScott McMurray-14/+14
2018-09-29Revert "Auto merge of #53508 - japaric:maybe-uninit, r=RalfJung"Ralf Jung-14/+13
This reverts commit c6e3d7fa3113aaa64602507f39d4627c427742ff, reversing changes made to 4591a245c7eec9f70d668982b1383cd2a6854af5.
2018-09-22core: fix deprecated warningsJorge Aparicio-13/+14
2018-08-24Rollup merge of #53636 - frewsxcv:frewsxcv-nth, r=rkruppekennytm-1/+1
Prefer `.nth(n)` over `.skip(n).next()`. Found by clippy.
2018-08-23Add missing fmt examplesGuillaume Gomez-0/+66
2018-08-23Prefer `.nth(n)` over `.skip(n).next()`.Corey Farwell-1/+1
Found by clippy.
2018-07-25Enforce #![deny(bare_trait_objects)] in src/libcoreljedrz-12/+12
2018-06-26migrate codebase to `..=` inclusive range patternsZack M. Davis-7/+7
These were stabilized in March 2018's #47813, and are the Preferred Way to Do It going forward (q.v. #51043).
2018-06-03Reexport fmt::Alignment into stdGuillaume Gomez-2/+1
2018-05-27Stabilize Formatter alignmentGuillaume Gomez-17/+18
2018-05-24Add more missing examples for FormatterGuillaume Gomez-3/+78
2018-05-07Add explanation for #[must_use] on Debug buildersManish Goregaokar-5/+5
2018-05-05Suggest more helpful formatting stringKornel-5/+6
2018-04-26Add more doc aliasesGuillaume Gomez-0/+2
2018-04-20Revert stabilization of `feature(never_type)`.Felix S. Klock II-2/+2
This commit is just covering the feature gate itself and the tests that made direct use of `!` and thus need to opt back into the feature. A follow on commit brings back the other change that motivates the revert: Namely, going back to the old rules for falling back to `()`.
2018-04-13core: Remove an implicit panic from Formatter::padAlex Crichton-1/+5
The expression `&s[..i]` in general can panic if `i` is out of bounds or not on a character boundary for a string, and this caused the codegen for `Formatter::pad` to be a bit larger than it otherwise needed to be. This commit replaces this with `s.get(..i).unwrap_or(&s)` which while having different behavior if `i` is out of bounds has a much smaller code footprint and otherwise avoids the need for `unsafe` code.
2018-04-03tweak fmt::Arguments docsAlex Burka-6/+5
Remove an outdated claim about passing something or other to a function. Also swap the variable names in the example.
2018-03-26Rollup merge of #49103 - glandium:uninitialized, r=cramertjTim Neumann-1/+1
Use an uninitialized buffer in GenericRadix::fmt_int, like in Display::fmt for numeric types The code using a slice of that buffer is only ever going to use bytes that are subsequently initialized.
2018-03-25Rollup merge of #49229 - Centril:doc/format_args_display_debug, r=steveklabnikkennytm-6/+66
Document format_args! / Arguments<'a> behavior wrt. Display and Debug This is a follow up PR to #49067 , this documents the behavior of `format_args!` (i.e: `Argument<'a>`) wrt. `Display` and `Debug`. r? @steveklabnik
2018-03-23Rollup merge of #49102 - glandium:decimal, r=aturonAlex Crichton-5/+0
Remove core::fmt::num::Decimal Before ebf9e1aaf6, it was used for Display::fmt, but ebf9e1aaf6 replaced that with a faster implementation, and nothing else uses it.