diff options
author | Neal H. Walfield <neal@pep.foundation> | 2019-11-07 09:53:42 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2019-11-07 09:53:42 +0100 |
commit | ec1063a3c684b5c44886907b2a9817ff2e557be7 (patch) | |
tree | feb416b8841d63e25961aa1b75338943b03a4d31 /openpgp | |
parent | 4030f8aca7d47d4cf9b076dd67c8f3344b77728c (diff) |
openpgp: Use vec_truncate instead of Vec::truncate.
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/src/parse/stream.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/openpgp/src/parse/stream.rs b/openpgp/src/parse/stream.rs index c84d1450..69422aaf 100644 --- a/openpgp/src/parse/stream.rs +++ b/openpgp/src/parse/stream.rs @@ -1555,6 +1555,7 @@ mod test { use failure; use super::*; use crate::parse::Parse; + use crate::vec_truncate; #[derive(Debug, PartialEq)] struct VHelper { @@ -1815,12 +1816,12 @@ mod test { Ok(0) => break, Ok(l) => { offset += l; - got.truncate(offset); + vec_truncate(&mut got, offset); }, Err(err) => panic!("Error reading data: {:?}", err), } } - got.truncate(offset); + vec_truncate(&mut got, offset); assert!(v.message_processed()); assert_eq!(got.len(), content.len()); assert_eq!(got, &content[..]); @@ -1844,13 +1845,13 @@ mod test { Ok(0) => break, Ok(l) => { offset += l; - got.truncate(offset); + vec_truncate(&mut got, offset); }, Err(err) => panic!("Error reading data: {:?}", err), } } assert!(v.message_processed()); - got.truncate(offset); + vec_truncate(&mut got, offset); assert_eq!(got.len(), content.len()); assert_eq!(got, &content[..]); } |