From 1d356624a1c03363be37886ffdad7dcf25ee81f6 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 23 Oct 2014 08:42:21 -0700 Subject: collections: Enable IndexMut for some collections This commit enables implementations of IndexMut for a number of collections, including Vec, RingBuf, SmallIntMap, TrieMap, TreeMap, and HashMap. At the same time this deprecates the `get_mut` methods on vectors in favor of using the indexing notation. cc #18424 --- src/libstd/path/windows.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libstd/path') diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index 1897c8638cc..1ddc027a07e 100644 --- a/src/libstd/path/windows.rs +++ b/src/libstd/path/windows.rs @@ -776,7 +776,7 @@ impl Path { let mut s = String::from_str(s.slice_to(len)); unsafe { let v = s.as_mut_vec(); - *v.get_mut(0) = (*v)[0] + v[0] = (*v)[0] .to_ascii() .to_uppercase() .to_byte(); @@ -784,7 +784,7 @@ impl Path { if is_abs { // normalize C:/ to C:\ unsafe { - *s.as_mut_vec().get_mut(2) = SEP_BYTE; + s.as_mut_vec()[2] = SEP_BYTE; } } Some(s) @@ -794,7 +794,7 @@ impl Path { let mut s = String::from_str(s.slice_to(len)); unsafe { let v = s.as_mut_vec(); - *v.get_mut(4) = (*v)[4].to_ascii().to_uppercase().to_byte(); + v[4] = (*v)[4].to_ascii().to_uppercase().to_byte(); } Some(s) } -- cgit 1.4.1-3-g733a5