about summary refs log tree commit diff
path: root/src/libcore/unstable/extfmt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore/unstable/extfmt.rs')
-rw-r--r--src/libcore/unstable/extfmt.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libcore/unstable/extfmt.rs b/src/libcore/unstable/extfmt.rs
index ee33e2ed20b..aefc527219e 100644
--- a/src/libcore/unstable/extfmt.rs
+++ b/src/libcore/unstable/extfmt.rs
@@ -520,7 +520,10 @@ pub mod rt {
             match cv.ty {
               TyDefault => uint_to_str_prec(u, 10, prec),
               TyHexLower => uint_to_str_prec(u, 16, prec),
-              TyHexUpper => str::to_upper(uint_to_str_prec(u, 16, prec)),
+
+              // FIXME: 4318 Instead of to_str_ascii, could use
+              // to_str_consume to not do a unneccessary copy.
+              TyHexUpper => uint_to_str_prec(u, 16, prec).to_ascii().to_upper().to_str_ascii(),
               TyBits => uint_to_str_prec(u, 2, prec),
               TyOctal => uint_to_str_prec(u, 8, prec)
             };