rust/src/libcore/fmt
Alex Crichton 2bb5b5c07c core: Remove an implicit panic from Formatter::pad
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-13 07:04:24 -07:00
..
rt Add missing Eq implementations 2016-09-18 14:26:49 +02:00
builders.rs Keep access to private Formatter fields in Formatter methods 2017-11-27 14:37:40 +01:00
float.rs Changed back inline markings. 2018-01-30 05:31:38 -07:00
mod.rs core: Remove an implicit panic from Formatter::pad 2018-04-13 07:04:24 -07:00
num.rs Rollup merge of #49103 - glandium:uninitialized, r=cramertj 2018-03-26 15:14:56 +02:00