summaryrefslogtreecommitdiffstats
path: root/openpgp/src
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
parent154ed7291ca9cce2de6e879e9785acc056a098a0 (diff)
Avoid identity slicing.
Diffstat (limited to 'openpgp/src')
-rw-r--r--openpgp/src/armor.rs10
-rw-r--r--openpgp/src/packet/mod.rs2
2 files changed, 6 insertions, 6 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();
diff --git a/openpgp/src/packet/mod.rs b/openpgp/src/packet/mod.rs
index 2347b43c..d81eb532 100644
--- a/openpgp/src/packet/mod.rs
+++ b/openpgp/src/packet/mod.rs
@@ -318,7 +318,7 @@ impl Common {
children: if let Some(ref container) = self.children {
container.packets.iter()
} else {
- let empty_packet_slice : &[Packet] = &[][..];
+ let empty_packet_slice : &[Packet] = &[];
empty_packet_slice.iter()
},
child: None,