Merge pull request #24 from bluss/clone_from

impl clone_from for ArrayVec and ArrayString
This commit is contained in:
bluss
2016-02-06 20:22:40 +01:00
3 changed files with 73 additions and 0 deletions
+6
View File
@@ -225,4 +225,10 @@ impl<A: Array<Item=u8> + Copy> Clone for ArrayString<A> {
fn clone(&self) -> ArrayString<A> {
*self
}
fn clone_from(&mut self, rhs: &Self) {
// guaranteed to fit due to types matching.
self.clear();
self.push_str(rhs).ok();
}
}