]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/ascii.rs
Implement IndexMut for String and str.
[rust.git] / src / libstd / ascii.rs
index 4a664acc32602737162d9e848257c4a9e3eab9c0..cf78fa7b69a00bb2ec8bb88e47ef947ad08724d5 100644 (file)
@@ -583,6 +583,10 @@ macro_rules! test {
         test!('!', '!');
         test!(b"h\xc3\xa9".to_vec(), b"H\xc3\xa9");
         test!("hıKß".to_string(), "HıKß");
+
+        let mut x = "Hello".to_string();
+        x[..3].make_ascii_uppercase();  // Test IndexMut on String.
+        assert_eq!(x, "HELlo")
     }
 
     #[test]