diff options
| author | Cory Sherman <coryshrmn@gmail.com> | 2018-05-24 04:39:35 -0700 |
|---|---|---|
| committer | Cory Sherman <coryshrmn@gmail.com> | 2018-05-24 05:01:40 -0700 |
| commit | 1440f300d848610b0cb798a735e2c75a94998aa9 (patch) | |
| tree | 02c294e0de1006f3fd964f9e68d427ee400b324f /src/liballoc/string.rs | |
| parent | b4463d788bfd30b622a87a0e6f8e9271b9102e50 (diff) | |
| download | rust-1440f300d848610b0cb798a735e2c75a94998aa9.tar.gz rust-1440f300d848610b0cb798a735e2c75a94998aa9.zip | |
stabilize RangeBounds collections_range #30877
rename RangeBounds::start() -> start_bound() rename RangeBounds::end() -> end_bound()
Diffstat (limited to 'src/liballoc/string.rs')
| -rw-r--r-- | src/liballoc/string.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index 449e3152d8f..a988b6a26d9 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -1493,12 +1493,12 @@ impl String { // Because the range removal happens in Drop, if the Drain iterator is leaked, // the removal will not happen. let len = self.len(); - let start = match range.start() { + let start = match range.start_bound() { Included(&n) => n, Excluded(&n) => n + 1, Unbounded => 0, }; - let end = match range.end() { + let end = match range.end_bound() { Included(&n) => n + 1, Excluded(&n) => n, Unbounded => len, @@ -1551,12 +1551,12 @@ impl String { // Replace_range does not have the memory safety issues of a vector Splice. // of the vector version. The data is just plain bytes. - match range.start() { + match range.start_bound() { Included(&n) => assert!(self.is_char_boundary(n)), Excluded(&n) => assert!(self.is_char_boundary(n + 1)), Unbounded => {}, }; - match range.end() { + match range.end_bound() { Included(&n) => assert!(self.is_char_boundary(n + 1)), Excluded(&n) => assert!(self.is_char_boundary(n)), Unbounded => {}, |
