about summary refs log tree commit diff
path: root/src/libcollections
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-04-21 15:23:13 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-04-21 15:23:13 -0700
commitc7017b3b3ef687e59c619c9b39cb73f0b93c0dff (patch)
treeb5a3558656617870313d267aeb3d090e5c6a9030 /src/libcollections
parent251f8d3fbd5b63d003f35dd1a82fc820f4af1ccd (diff)
parent16181e686a0b03960887889e28ef5f636ceccd4d (diff)
downloadrust-c7017b3b3ef687e59c619c9b39cb73f0b93c0dff.tar.gz
rust-c7017b3b3ef687e59c619c9b39cb73f0b93c0dff.zip
rollup merge of #24661: SimonSapin/fmt-write-char
as accepted in [RFC 526](https://github.com/rust-lang/rfcs/blob/master/text/0526-fmt-text-writer.md).

Note that this brand new method is marked as **stable**. I judged this safe enough: it’s simple enough that it’s very unlikely to change. Still, I can mark it unstable instead if you prefer.

r? @alexcrichton
Diffstat (limited to 'src/libcollections')
-rw-r--r--src/libcollections/string.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs
index 85f8a9caaaa..25f450e53a4 100644
--- a/src/libcollections/string.rs
+++ b/src/libcollections/string.rs
@@ -1082,4 +1082,10 @@ impl fmt::Write for String {
         self.push_str(s);
         Ok(())
     }
+
+    #[inline]
+    fn write_char(&mut self, c: char) -> fmt::Result {
+        self.push(c);
+        Ok(())
+    }
 }