Add DerefMut for ArrayString

This commit is contained in:
bluss
2016-01-13 12:59:06 +01:00
parent 2046e3f726
commit 62d372ce1f
2 changed files with 19 additions and 1 deletions
+6
View File
@@ -283,6 +283,12 @@ fn test_string() {
assert!(t.push_str(text).is_err());
assert_eq!(&t, "");
t.push_str("ab").unwrap();
// DerefMut
let tmut: &mut str = &mut t;
assert_eq!(tmut, "ab");
// Test Error trait / try
let t = || -> Result<(), Box<Error>> {
let mut t = ArrayString::<[_; 2]>::new();