Skip to content

Instantly share code, notes, and snippets.

@DaGenix
Created February 4, 2014 02:20
Show Gist options
  • Save DaGenix/8796382 to your computer and use it in GitHub Desktop.
Save DaGenix/8796382 to your computer and use it in GitHub Desktop.
pub struct ReaderRef<'a, R> {
priv reader: &'a mut R
}
impl <'a, R: Reader> ReaderRef<'a, R> {
pub fn new<'a>(reader: &'a mut R) -> ReaderRef<'a, R> {
ReaderRef {
reader: reader
}
}
}
impl <'a, R: Reader> Reader for ReaderWrapper<'a, R> {
fn read(&mut self, out: &mut [u8]) -> Option<uint> {
self.r.read(out)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment