diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-02-07 16:34:02 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-02-07 16:34:02 -0800 |
| commit | 0c13ee22ade792f3662641a4ab8470ecfe33c236 (patch) | |
| tree | c8bd0eda7b09102be77428d57c3133b9dabe42f4 | |
| parent | 1aa23947a630fbc5678eeabeca5a653a37871bdd (diff) | |
| download | rust-0c13ee22ade792f3662641a4ab8470ecfe33c236.tar.gz rust-0c13ee22ade792f3662641a4ab8470ecfe33c236.zip | |
core: Use substr in extfmt instead of slice_bytes
| -rw-r--r-- | src/libcore/extfmt.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libcore/extfmt.rs b/src/libcore/extfmt.rs index f792c0682fd..d87ba9a5ca9 100644 --- a/src/libcore/extfmt.rs +++ b/src/libcore/extfmt.rs @@ -321,13 +321,12 @@ mod rt { // For strings, precision is the maximum characters // displayed - // FIXME: substr works on bytes, not chars! let unpadded = alt cv.precision { count_implied { s } count_is(max) { if max as uint < str::char_len(s) { - str::unsafe::slice_bytes(s, 0u, max as uint) + str::substr(s, 0u, max as uint) } else { s } } }; |
