diff options
author | David Tolnay <dtolnay@gmail.com> | 2023-01-19 18:56:13 -0800 |
---|---|---|
committer | David Tolnay <dtolnay@gmail.com> | 2023-01-19 18:56:13 -0800 |
commit | 0ca09b9b1a2111f53702c71b47e46c8ffbcf185a (patch) | |
tree | 9d4395efbbef235fdea7ee7b1702e8b924b8bee5 /src | |
parent | 759a9dddda8e99aba15ec655a39ea905d1e7f531 (diff) | |
download | cxx-0ca09b9b1a2111f53702c71b47e46c8ffbcf185a.tar.gz |
Improve formatting of single quote in Debug of CxxString
Diffstat (limited to 'src')
-rw-r--r-- | src/lossy.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lossy.rs b/src/lossy.rs index d68a2e7b..8ccf0f93 100644 --- a/src/lossy.rs +++ b/src/lossy.rs @@ -37,7 +37,7 @@ pub fn debug(mut bytes: &[u8], f: &mut fmt::Formatter) -> fmt::Result { let mut written = 0; for (i, ch) in valid.char_indices() { let esc = ch.escape_debug(); - if esc.len() != 1 { + if esc.len() != 1 && ch != '\'' { f.write_str(&valid[written..i])?; for ch in esc { f.write_char(ch)?; |