From 98566ea951fec6d359e2d98367d34c06e2243ee2 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 30 Jun 2015 19:26:03 -0700 Subject: std: Fix formatting flags for chars This recently regressed in #24689, and this updates the `Display` implementation to take formatting flags into account. Closes #26625 --- src/libcoretest/fmt/mod.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libcoretest/fmt') diff --git a/src/libcoretest/fmt/mod.rs b/src/libcoretest/fmt/mod.rs index cdb9c38f027..42872589bb0 100644 --- a/src/libcoretest/fmt/mod.rs +++ b/src/libcoretest/fmt/mod.rs @@ -16,4 +16,6 @@ fn test_format_flags() { // No residual flags left by pointer formatting let p = "".as_ptr(); assert_eq!(format!("{:p} {:x}", p, 16), format!("{:p} 10", p)); + + assert_eq!(format!("{: >3}", 'a'), " a"); } -- cgit 1.4.1-3-g733a5