diff --git a/src/bot.rs b/src/bot.rs index db5889d..d531015 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -90,8 +90,8 @@ impl StreamableBot{ } pub fn load_segment(&mut self,segment_id:SegmentId)->Result{ let block_id=*self.segment_id_to_block_id.get(segment_id.get() as usize).ok_or(Error::InvalidSegmentId(segment_id))?; - let mut block=self.file.take_block(block_id).map_err(Error::File)?; + let mut block=self.file.block_reader(block_id).map_err(Error::File)?; let segment=block.read_le().map_err(Error::InvalidSegment)?; Ok(segment) } -} \ No newline at end of file +} diff --git a/src/file.rs b/src/file.rs index 1a9e9dd..b78405c 100644 --- a/src/file.rs +++ b/src/file.rs @@ -82,7 +82,7 @@ impl File{ data:input, }) } - pub(crate) fn take_block(&mut self,block_id:BlockId)->Result,Error>{ + pub(crate) fn block_reader(&mut self,block_id:BlockId)->Result,Error>{ if self.header.block_location.len() as u32<=block_id.get(){ return Err(Error::InvalidBlockId(block_id)) } diff --git a/src/map.rs b/src/map.rs index 5c8fc54..29cb710 100644 --- a/src/map.rs +++ b/src/map.rs @@ -112,7 +112,7 @@ impl StreamableMap{ //load resources into self.resources //return Region let block_id=*self.node_id_to_block_id.get(node_id.get() as usize).ok_or(Error::InvalidBvhNodeId(node_id))?; - let mut block=self.file.take_block(block_id).map_err(Error::File)?; + let mut block=self.file.block_reader(block_id).map_err(Error::File)?; let region:Region=block.read_le().map_err(Error::InvalidRegion)?; Ok(region.models) }