fn truncate(&mut self, last_offs: u32) -> io::Result<()> {
		// simplifying assumption: we always remove older than what's in tmp
		self.removed_tmp = vec![];
		// DEBUG
		let _ = self.flush_truncate(last_offs);

		// backing it up before truncating
		self.removed_bak = self.removed.clone();

		if last_offs == 0 {
			self.removed = vec![];
		} else {
			self.removed = self.removed
				.iter()
				.filter(|&&(_, idx)| idx < last_offs)
				.map(|x| *x)
				.collect();
		}
		Ok(())
	}
/// Truncate and empties the remove log.
Truncate and empties the remove log.
Truncate and empties the remove log .
fn truncate(&mut self, last_offs: u32) -> io::Result<()> {
		// simplifying assumption: we always remove older than what's in tmp
		self.removed_tmp = vec![];
		// DEBUG
		let _ = self.flush_truncate(last_offs);
		// backing it up before truncating
		self.removed_bak = self.removed.clone();
		if last_offs == 0 {
			self.removed = vec![];
		} else {
			self.removed = self.removed
				.iter()
				.filter(|&&(_, idx)| idx < last_offs)
				.map(|x| *x)
				.collect();
		}
		Ok(())
	}
fn truncate ( & mut self , last_offs : u32 ) -> io :: Result < ( ) > { // simplifying assumption: we always remove older than what's in tmp self . removed_tmp = vec ! [ ] ; // DEBUG let _ = self . flush_truncate ( last_offs ) ; // backing it up before truncating self . removed_bak = self . removed . clone ( ) ; if last_offs == 0 { self . removed = vec ! [ ] ; } else { self . removed = self . removed . iter ( ) . filter ( | & & ( _ , idx ) | idx < last_offs ) . map ( | x | * x ) . collect ( ) ; } Ok ( ( ) ) }
Truncate and empties the remove log.
Truncate and empties the remove log .
&mut self
last_offs
u32