Am 29.04.2014 22:51, schrieb Alex Crichton:
> 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!)
Thanks so much! This works!
Actually I was trying to explicitly specify the type as in:
let rdr: RefReader<PipeStream> = t.by_ref();
and was wondering why it failed.
Regards,
Michael
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev