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:
Joseph Birr-Pixton 2019-07-06 15:55:00 +01:00
parent e4d7dc25aa
commit ac8050fc08
1 changed files with 6 additions and 2 deletions

View File

@ -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;
}