From 87946abb6365ab36c50b2c32914a25962611811e Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Thu, 5 Aug 2021 14:28:00 +0200 Subject: [PATCH] Avoid egregious &'a mut R --- implementations/rust/preserves/src/value/reader.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/implementations/rust/preserves/src/value/reader.rs b/implementations/rust/preserves/src/value/reader.rs index a871e27..51c2271 100644 --- a/implementations/rust/preserves/src/value/reader.rs +++ b/implementations/rust/preserves/src/value/reader.rs @@ -260,18 +260,18 @@ pub trait BinarySource<'de>: Sized { } } -pub struct IOBinarySource<'a, R: io::Read + io::Seek> { - pub read: &'a mut R, +pub struct IOBinarySource { + pub read: R, pub buf: Option, } -impl<'a, R: io::Read + io::Seek> IOBinarySource<'a, R> { - pub fn new(read: &'a mut R) -> Self { +impl IOBinarySource { + pub fn new(read: R) -> Self { 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 { type Mark = u64; fn mark(&mut self) -> io::Result {