diff options
| author | bors <bors@rust-lang.org> | 2016-08-02 02:30:17 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-02 02:30:17 -0700 |
| commit | 97d5be98191038f24bf3c98f772cbf1662486581 (patch) | |
| tree | 137c07941bf9ee92fb4f00d58c8b95d99ab6bcef /src/libstd/sys | |
| parent | 34d14e7eed48c755a660224266e2c86669cf5483 (diff) | |
| parent | bb6c27e74d08b78709b6fb87f5cb149f4366ccb6 (diff) | |
| download | rust-97d5be98191038f24bf3c98f772cbf1662486581.tar.gz rust-97d5be98191038f24bf3c98f772cbf1662486581.zip | |
Auto merge of #35084 - tbu-:pr_lowercase_wtf8_debug, r=brson
Escape the unmatched surrogates with lower-case hexadecimal numbers It's done the same way for the rest of the codepoint escapes.
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/common/wtf8.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sys/common/wtf8.rs b/src/libstd/sys/common/wtf8.rs index c0e6ec46b55..c1b4f8a8c88 100644 --- a/src/libstd/sys/common/wtf8.rs +++ b/src/libstd/sys/common/wtf8.rs @@ -408,7 +408,7 @@ impl fmt::Debug for Wtf8 { &self.bytes[pos .. surrogate_pos] )}, )?; - write!(formatter, "\\u{{{:X}}}", surrogate)?; + write!(formatter, "\\u{{{:x}}}", surrogate)?; pos = surrogate_pos + 3; } } @@ -1066,7 +1066,7 @@ mod tests { fn wtf8buf_show() { let mut string = Wtf8Buf::from_str("a\té \u{7f}💩\r"); string.push(CodePoint::from_u32(0xD800).unwrap()); - assert_eq!(format!("{:?}", string), "\"a\\té \\u{7f}\u{1f4a9}\\r\\u{D800}\""); + assert_eq!(format!("{:?}", string), "\"a\\té \\u{7f}\u{1f4a9}\\r\\u{d800}\""); } #[test] |
