mirror of https://github.com/ctz/rustls
Fix new inference failures in test code
This was relying on there only being one AsMut<[u8]> which (four deep in the dependency tree) is no longer true.
This commit is contained in:
parent
e4d7dc25aa
commit
ac8050fc08
|
@ -99,7 +99,10 @@ pub fn transfer(left: &mut dyn Session, right: &mut dyn Session) -> usize {
|
|||
let mut total = 0;
|
||||
|
||||
while left.wants_write() {
|
||||
let sz = left.write_tls(&mut buf.as_mut()).unwrap();
|
||||
let sz = {
|
||||
let into_buf: &mut io::Write = &mut &mut buf[..];
|
||||
left.write_tls(into_buf).unwrap()
|
||||
};
|
||||
total += sz;
|
||||
if sz == 0 {
|
||||
return total;
|
||||
|
@ -107,7 +110,8 @@ pub fn transfer(left: &mut dyn Session, right: &mut dyn Session) -> usize {
|
|||
|
||||
let mut offs = 0;
|
||||
loop {
|
||||
offs += right.read_tls(&mut buf[offs..sz].as_ref()).unwrap();
|
||||
let from_buf: &mut io::Read = &mut &buf[offs..sz];
|
||||
offs += right.read_tls(from_buf).unwrap();
|
||||
if sz == offs {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue