diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-10-23 08:42:21 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-10-30 08:54:30 -0700 |
| commit | 1d356624a1c03363be37886ffdad7dcf25ee81f6 (patch) | |
| tree | 4aef71be9e3f509b1bc8b4880e6894656e6404c4 /src/libstd/path | |
| parent | 18a3db6aa1ce9e66b0c9cb776588d56470c6078b (diff) | |
| download | rust-1d356624a1c03363be37886ffdad7dcf25ee81f6.tar.gz rust-1d356624a1c03363be37886ffdad7dcf25ee81f6.zip | |
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
Diffstat (limited to 'src/libstd/path')
| -rw-r--r-- | src/libstd/path/windows.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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) } |
