about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-07-30 05:37:33 +0200
committerGitHub <noreply@github.com>2019-07-30 05:37:33 +0200
commit51e50ed82770e8e48960797d822841e333005202 (patch)
tree8572db191ec654d31405ab4bf4f236e8794b20a3 /src/liballoc
parent36029878e739f23bb774104cc3250e6f03cf8685 (diff)
parent3325ff6df47f75cdf4891b35dcaf565f7ffb22cf (diff)
downloadrust-51e50ed82770e8e48960797d822841e333005202.tar.gz
rust-51e50ed82770e8e48960797d822841e333005202.zip
Rollup merge of #63000 - max-sixty:chars-display, r=alexcrichton
Impl Debug for Chars

Closes https://github.com/rust-lang/rust/issues/62947, making `Debug` more consistent with the struct's output and purpose

Let me know any feedback!
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/tests/str.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/liballoc/tests/str.rs b/src/liballoc/tests/str.rs
index b197516403f..c5198ca39fe 100644
--- a/src/liballoc/tests/str.rs
+++ b/src/liballoc/tests/str.rs
@@ -1109,6 +1109,16 @@ fn test_iterator_last() {
 }
 
 #[test]
+fn test_chars_debug() {
+    let s = "ศไทย中华Việt Nam";
+    let c = s.chars();
+    assert_eq!(
+        format!("{:?}", c),
+        r#"Chars(['ศ', 'ไ', 'ท', 'ย', '中', '华', 'V', 'i', 'ệ', 't', ' ', 'N', 'a', 'm'])"#
+    );
+}
+
+#[test]
 fn test_bytesator() {
     let s = "ศไทย中华Việt Nam";
     let v = [