The by_ref() method exists on both the Reader and the Writer trait,
and you're working with a stream which implements both Reader and
Writer (hence the confusion by the compiler).
You could work around it with something like:
fn rdr<'a, T: Reader>(t: &'a mut T) -> RefReader<'a, T> {
t.by_ref()
}
Eventually, with UFCS, you'll be able to do something like:
let rdr = Reader::by_ref(&mut inp);
(hopefully soon!)
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev