diff --git a/src/file.rs b/src/file.rs index 1cc2d8e..75b89cd 100644 --- a/src/file.rs +++ b/src/file.rs @@ -92,7 +92,7 @@ impl File{ data:input, }) } - pub(crate) fn as_mut(&mut self)->&mut R{ + pub(crate) fn data_mut(&mut self)->&mut R{ &mut self.data } pub(crate) fn block_reader(&mut self,block_id:BlockId)->Result,Error>{ @@ -102,7 +102,7 @@ impl File{ let block_start=self.header.block_location[block_id.get() as usize]; let block_end=self.header.block_location[block_id.get() as usize+1]; self.data.seek(std::io::SeekFrom::Start(block_start)).map_err(Error::Seek)?; - Ok(self.as_mut().take_seek(block_end-block_start)) + Ok(self.data_mut().take_seek(block_end-block_start)) } pub(crate) fn fourcc(&self)->FourCC{ self.header.fourcc diff --git a/src/map.rs b/src/map.rs index 02f8868..a5ef6f7 100644 --- a/src/map.rs +++ b/src/map.rs @@ -214,7 +214,7 @@ pub struct StreamableMap{ impl StreamableMap{ pub(crate) fn new(mut file:crate::file::File)->Result{ //assume the file seek is in the right place to start reading a map header - let header:MapHeader=file.as_mut().read_le().map_err(Error::InvalidHeader)?; + let header:MapHeader=file.data_mut().read_le().map_err(Error::InvalidHeader)?; let modes=header.modes.into_iter().map(TryInto::try_into).collect::>().map_err(Error::InvalidMode)?; let attributes=header.attributes.into_iter().map(Into::into).collect(); let render_configs=header.render_configs.into_iter().map(Into::into).collect();