File tree 2 files changed +5
-8
lines changed
2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -67,16 +67,14 @@ impl<T: AsRef<[u8]>> Window<T> {
67
67
68
68
/// Changes the range of this window to the range specified.
69
69
///
70
- /// Returns the windows back to chain multiple calls to this method.
71
- ///
72
70
/// # Panics
73
71
///
74
72
/// This method will panic if `range` is out of bounds for the underlying
75
73
/// slice or if [`start_bound()`] of `range` comes after the [`end_bound()`].
76
74
///
77
75
/// [`start_bound()`]: std::ops::RangeBounds::start_bound
78
76
/// [`end_bound()`]: std::ops::RangeBounds::end_bound
79
- pub fn set < R : RangeBounds < usize > > ( & mut self , range : R ) -> & mut Self {
77
+ pub fn set < R : RangeBounds < usize > > ( & mut self , range : R ) {
80
78
let start = match range. start_bound ( ) {
81
79
Bound :: Included ( n) => * n,
82
80
Bound :: Excluded ( n) => * n + 1 ,
@@ -93,7 +91,6 @@ impl<T: AsRef<[u8]>> Window<T> {
93
91
94
92
self . range . start = start;
95
93
self . range . end = end;
96
- self
97
94
}
98
95
}
99
96
Original file line number Diff line number Diff line change @@ -3,10 +3,10 @@ use futures::io::Window;
3
3
#[ test]
4
4
fn set ( ) {
5
5
let mut buffer = Window :: new ( & [ 1 , 2 , 3 ] ) ;
6
- buffer. set ( ..3 )
7
- . set ( 3 ..3 )
8
- . set ( 3 ..=2 ) // == 3..3
9
- . set ( 0 ..2 ) ;
6
+ buffer. set ( ..3 ) ;
7
+ buffer . set ( 3 ..3 ) ;
8
+ buffer . set ( 3 ..=2 ) ; // == 3..3
9
+ buffer . set ( 0 ..2 ) ;
10
10
11
11
assert_eq ! ( buffer. as_ref( ) , & [ 1 , 2 ] ) ;
12
12
}
You can’t perform that action at this time.
0 commit comments