@@ -58,13 +58,14 @@ Remove `Vec::drain` and add the following method:
58
58
///
59
59
/// Panics if the range is decreasing or if the upper bound is larger than the
60
60
/// length of the vector.
61
- pub fn drain <T : Drainer >(& mut self , range : T ) -> RangeIter <T > {
62
- range . drain (self )
63
- }
61
+ pub fn drain <T : Trait >(& mut self , range : T ) -> /* ... */ ;
64
62
```
65
63
66
- Where ` Drainer ` should be implemented for ` Range<usize> ` , ` RangeTo<usize> ` ,
67
- ` RangeFrom<usize> ` , ` FullRange ` , and ` usize ` .
64
+ Where ` Trait ` is some trait that is implemented for at least ` Range<usize> ` ,
65
+ ` RangeTo<usize> ` , ` RangeFrom<usize> ` , ` FullRange ` , and ` usize ` .
66
+
67
+ The precise nature of the return value is to be determined during implementation
68
+ and may or may not depend on ` T ` .
68
69
69
70
Add ` String::drain ` :
70
71
@@ -77,11 +78,11 @@ Add `String::drain`:
77
78
/// Panics if the range is decreasing, if the upper bound is larger than the
78
79
/// length of the String, or if the start and the end of the range don't lie on
79
80
/// character boundaries.
80
- pub fn drain (& mut self , range : /* ? */ ) -> /* ? */ {
81
- // ?
82
- }
81
+ pub fn drain <T : Trait >(& mut self , range : T ) -> /* ... */ ;
83
82
```
84
83
84
+ Where ` Trait ` and the return value are as above but need not be the same.
85
+
85
86
# Drawbacks
86
87
87
88
- The function signature differs from other collections.
0 commit comments