forked from syndicate-lang/preserves
Avoid egregious &'a mut R
This commit is contained in:
parent
96f5c9f434
commit
87946abb63
|
@ -260,18 +260,18 @@ pub trait BinarySource<'de>: Sized {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct IOBinarySource<'a, R: io::Read + io::Seek> {
|
pub struct IOBinarySource<R: io::Read + io::Seek> {
|
||||||
pub read: &'a mut R,
|
pub read: R,
|
||||||
pub buf: Option<u8>,
|
pub buf: Option<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, R: io::Read + io::Seek> IOBinarySource<'a, R> {
|
impl<R: io::Read + io::Seek> IOBinarySource<R> {
|
||||||
pub fn new(read: &'a mut R) -> Self {
|
pub fn new(read: R) -> Self {
|
||||||
IOBinarySource { read, buf: None }
|
IOBinarySource { read, buf: None }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'de, 'a, R: io::Read + io::Seek> BinarySource<'de> for IOBinarySource<'a, R> {
|
impl<'de, R: io::Read + io::Seek> BinarySource<'de> for IOBinarySource<R> {
|
||||||
type Mark = u64;
|
type Mark = u64;
|
||||||
|
|
||||||
fn mark(&mut self) -> io::Result<Self::Mark> {
|
fn mark(&mut self) -> io::Result<Self::Mark> {
|
||||||
|
|
Loading…
Reference in New Issue