File tree 1 file changed +5
-14
lines changed
1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -24,39 +24,30 @@ impl<T: fmt::Debug> fmt::Debug for MaybeHttpsStream<T> {
24
24
}
25
25
}
26
26
27
- impl < T : Read + Write > Read for MaybeHttpsStream < T > {
27
+ impl < T : AsyncRead + AsyncWrite > Read for MaybeHttpsStream < T > {
28
28
#[ inline]
29
29
fn read ( & mut self , buf : & mut [ u8 ] ) -> io:: Result < usize > {
30
30
match * self {
31
31
MaybeHttpsStream :: Http ( ref mut s) => s. read ( buf) ,
32
- MaybeHttpsStream :: Https ( ref mut s) => {
33
- let ( _, cs) = s. get_mut ( ) ;
34
- cs. read ( buf)
35
- }
32
+ MaybeHttpsStream :: Https ( ref mut s) => s. read ( buf)
36
33
}
37
34
}
38
35
}
39
36
40
- impl < T : Read + Write > Write for MaybeHttpsStream < T > {
37
+ impl < T : AsyncRead + AsyncWrite > Write for MaybeHttpsStream < T > {
41
38
#[ inline]
42
39
fn write ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > {
43
40
match * self {
44
41
MaybeHttpsStream :: Http ( ref mut s) => s. write ( buf) ,
45
- MaybeHttpsStream :: Https ( ref mut s) => {
46
- let ( _, cs) = s. get_mut ( ) ;
47
- cs. write ( buf)
48
- }
42
+ MaybeHttpsStream :: Https ( ref mut s) => s. write ( buf)
49
43
}
50
44
}
51
45
52
46
#[ inline]
53
47
fn flush ( & mut self ) -> io:: Result < ( ) > {
54
48
match * self {
55
49
MaybeHttpsStream :: Http ( ref mut s) => s. flush ( ) ,
56
- MaybeHttpsStream :: Https ( ref mut s) => {
57
- let ( _, cs) = s. get_mut ( ) ;
58
- cs. flush ( )
59
- }
50
+ MaybeHttpsStream :: Https ( ref mut s) => s. flush ( )
60
51
}
61
52
}
62
53
}
You can’t perform that action at this time.
0 commit comments