diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2021-10-29 14:40:07 +0200 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2021-10-29 14:40:07 +0200 |
commit | 379524159c95f1c3639976ccf35f9d47cd9732ac (patch) | |
tree | a420329fa8bbb301f2d290d4813621b1c64afd12 /nihav-itu/src/codecs/h264/test/raw_demux.rs | |
parent | fa49f0616b3b7f6454ea5722f8a6d1ca38908df6 (diff) | |
download | nihav-379524159c95f1c3639976ccf35f9d47cd9732ac.tar.gz |
replace vec.truncate(0) with vec.clear()
Diffstat (limited to 'nihav-itu/src/codecs/h264/test/raw_demux.rs')
-rw-r--r-- | nihav-itu/src/codecs/h264/test/raw_demux.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nihav-itu/src/codecs/h264/test/raw_demux.rs b/nihav-itu/src/codecs/h264/test/raw_demux.rs index 3bdbd90..857016d 100644 --- a/nihav-itu/src/codecs/h264/test/raw_demux.rs +++ b/nihav-itu/src/codecs/h264/test/raw_demux.rs @@ -10,7 +10,7 @@ struct RawH264Demuxer<'a> { } fn read_nal(src: &mut ByteReader, dst: &mut Vec<u8>) -> DemuxerResult<()> { - dst.truncate(0); + dst.clear(); loop { let b = src.read_byte()?; if b == 0 { @@ -124,7 +124,7 @@ impl<'a> DemuxCore<'a> for RawH264Demuxer<'a> { let mut buf: Vec<u8> = Vec::with_capacity(65536); if !self.frame_buf.is_empty() { put_nal(&mut buf, &self.frame_buf); - self.frame_buf.truncate(0); + self.frame_buf.clear(); } let strres = strmgr.get_stream(0); if strres.is_none() { |