summaryrefslogtreecommitdiffstats
path: root/openpgp/src/armor.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2018-11-14 17:11:25 +0100
committerJustus Winter <justus@sequoia-pgp.org>2018-11-14 17:27:50 +0100
commit3f0ed2e703f8db48501fdfe18df286bcdbaa2d3e (patch)
treefa67ade490d3ddaffd4b544f7be5a849d94c9877 /openpgp/src/armor.rs
parent154ed7291ca9cce2de6e879e9785acc056a098a0 (diff)
Avoid identity slicing.
Diffstat (limited to 'openpgp/src/armor.rs')
-rw-r--r--openpgp/src/armor.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/openpgp/src/armor.rs b/openpgp/src/armor.rs
index b0d0cae4..f7cf5852 100644
--- a/openpgp/src/armor.rs
+++ b/openpgp/src/armor.rs
@@ -1056,7 +1056,7 @@ mod test {
let mut buf = Vec::new();
{
- let mut w = Writer::new(&mut buf, Kind::File, &[][..]).unwrap();
+ let mut w = Writer::new(&mut buf, Kind::File, &[]).unwrap();
w.write(&[]).unwrap(); // Avoid zero-length optimization.
w.write_all(&bin).unwrap();
}
@@ -1078,7 +1078,7 @@ mod test {
let mut buf = Vec::new();
{
- let mut w = Writer::new(&mut buf, Kind::File, &[][..]).unwrap();
+ let mut w = Writer::new(&mut buf, Kind::File, &[]).unwrap();
w.write(&[]).unwrap(); // Avoid zero-length optimization.
for (i, _) in bin.iter().enumerate() {
w.write(&bin[i..i+1]).unwrap();
@@ -1095,7 +1095,7 @@ mod test {
// unused.
let mut buf = Vec::new();
{
- drop(Writer::new(&mut buf, Kind::File, &[][..]).unwrap());
+ drop(Writer::new(&mut buf, Kind::File, &[]).unwrap());
}
assert!(buf.is_empty());
@@ -1103,7 +1103,7 @@ mod test {
// string.
let mut buf = Vec::new();
{
- let mut w = Writer::new(&mut buf, Kind::File, &[][..]).unwrap();
+ let mut w = Writer::new(&mut buf, Kind::File, &[]).unwrap();
w.write(&[]).unwrap();
}
assert_eq!(
@@ -1306,7 +1306,7 @@ mod test {
}
let mut encoded = Vec::new();
- Writer::new(&mut encoded, kind, &[][..]).unwrap()
+ Writer::new(&mut encoded, kind, &[]).unwrap()
.write_all(&payload)
.unwrap();