From c1206cbab4bc5a158da01db138bbd81d384b3393 Mon Sep 17 00:00:00 2001 From: Gulshan Singh Date: Wed, 28 Jan 2015 19:18:12 -0500 Subject: [PATCH] Implemented Add for String --- src/libcollections/string.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 5189b825f1615..7369d165229fb 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -853,6 +853,18 @@ impl<'a> Add<&'a str> for String { } } +#[unstable(feature = "collections", + reason = "recent addition, needs more experience")] +impl<'a> Add for String { + type Output = String; + + #[inline] + fn add(mut self, other: char) -> String { + self.push(other); + self + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl ops::Index> for String { type Output = str;