Skip to content

Commit 994e525

Browse files
committed
Merge branch 'collections2' of https://github.com/Gankro/rfcs into collections2
2 parents 3a3ddcc + 6c45e05 commit 994e525

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

text/0000-collections-reform-part-2.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Based on feedback and collections reform landing, this RFC proposes the followin
222222

223223
```
224224
impl Map<K, V> {
225-
fn entry<O: ToOwned<K>>(&'a mut self, key: &O) -> Entry<'a, O, V>
225+
fn entry<'a, O: ToOwned<K>>(&'a mut self, key: &O) -> Entry<'a, O, V>
226226
}
227227
228228
pub enum Entry<'a, O: 'a, V: 'a> {
@@ -231,7 +231,7 @@ pub enum Entry<'a, O: 'a, V: 'a> {
231231
}
232232
233233
impl Entry<'a, O: 'a, V:'a> {
234-
get(self) -> Result<&'a mut V, VacantEntry<'a, O, V>>
234+
fn get(self) -> Result<&'a mut V, VacantEntry<'a, O, V>>
235235
}
236236
237237
impl<'a, K, V> VacantEntry<'a, K, V> {
@@ -335,7 +335,7 @@ enum RingBufSlice<'a, T> {
335335
```
336336
/// Gets a slice over all the elements in the RingBuf. This may require shifting
337337
/// all the elements to make this possible.
338-
pub fn to_slice(&'a self) -> &'a [T]
338+
pub fn to_slice(&mut self) -> &[T]
339339
```
340340

341341
The one settled on had the benefit of being the simplest. In particular, having the enum wasn't
@@ -346,4 +346,4 @@ to avoid code-duplication.
346346

347347
`reserve_index` vs `reserve_len` and `Ringbuf::as_slice` are the two major ones.
348348

349-
[part1]: https://github.com/rust-lang/rfcs/blob/master/text/0235-collections-conventions.md
349+
[part1]: https://github.com/rust-lang/rfcs/blob/master/text/0235-collections-conventions.md

0 commit comments

Comments
 (0)