replace vec.truncate(0) with vec.clear()
[nihav.git] / nihav-codec-support / src / data / mod.rs
index 2ad6b8c9e1fb1fad2e2c1848347acb217ddccd72..eba029939a3a46643dea1fd3a650a7eccf1f3927 100644 (file)
@@ -54,7 +54,7 @@ impl<T:Copy> GenericCache<T> {
     pub fn full_size(&self) -> usize { self.stride * (self.height + 1) + 1 }
     /// Resets the cache state.
     pub fn reset(&mut self) {
-        self.data.truncate(0);
+        self.data.clear();
         let size = self.full_size();
         self.data.resize(size, self.default);
         self.xpos = self.stride + 1;