diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2018-11-14 17:11:25 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2018-11-14 17:27:50 +0100 |
commit | 3f0ed2e703f8db48501fdfe18df286bcdbaa2d3e (patch) | |
tree | fa67ade490d3ddaffd4b544f7be5a849d94c9877 /openpgp | |
parent | 154ed7291ca9cce2de6e879e9785acc056a098a0 (diff) |
Avoid identity slicing.
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/examples/encrypt-for.rs | 2 | ||||
-rw-r--r-- | openpgp/examples/notarize.rs | 2 | ||||
-rw-r--r-- | openpgp/examples/sign-detached.rs | 2 | ||||
-rw-r--r-- | openpgp/examples/sign.rs | 2 | ||||
-rw-r--r-- | openpgp/examples/wrap-literal.rs | 2 | ||||
-rw-r--r-- | openpgp/src/armor.rs | 10 | ||||
-rw-r--r-- | openpgp/src/packet/mod.rs | 2 |
7 files changed, 11 insertions, 11 deletions
diff --git a/openpgp/examples/encrypt-for.rs b/openpgp/examples/encrypt-for.rs index bc70e307..be2f1cc5 100644 --- a/openpgp/examples/encrypt-for.rs +++ b/openpgp/examples/encrypt-for.rs @@ -42,7 +42,7 @@ fn main() { // Compose a writer stack corresponding to the output format and // packet structure we want. First, we want the output to be // ASCII armored. - let sink = armor::Writer::new(io::stdout(), armor::Kind::Message, &[][..]) + let sink = armor::Writer::new(io::stdout(), armor::Kind::Message, &[]) .expect("Failed to create an armored writer"); // Stream an OpenPGP message. diff --git a/openpgp/examples/notarize.rs b/openpgp/examples/notarize.rs index 6643e573..126eb657 100644 --- a/openpgp/examples/notarize.rs +++ b/openpgp/examples/notarize.rs @@ -35,7 +35,7 @@ fn main() { // Compose a writer stack corresponding to the output format and // packet structure we want. First, we want the output to be // ASCII armored. - let sink = armor::Writer::new(io::stdout(), armor::Kind::Message, &[][..]) + let sink = armor::Writer::new(io::stdout(), armor::Kind::Message, &[]) .expect("Failed to create an armored writer."); // Stream an OpenPGP message. diff --git a/openpgp/examples/sign-detached.rs b/openpgp/examples/sign-detached.rs index bc071ba6..a9764db8 100644 --- a/openpgp/examples/sign-detached.rs +++ b/openpgp/examples/sign-detached.rs @@ -28,7 +28,7 @@ fn main() { // Compose a writer stack corresponding to the output format and // packet structure we want. First, we want the output to be // ASCII armored. - let sink = armor::Writer::new(io::stdout(), armor::Kind::Signature, &[][..]) + let sink = armor::Writer::new(io::stdout(), armor::Kind::Signature, &[]) .expect("Failed to create armored writer."); // Stream an OpenPGP message. diff --git a/openpgp/examples/sign.rs b/openpgp/examples/sign.rs index 6b05a08c..53bc158c 100644 --- a/openpgp/examples/sign.rs +++ b/openpgp/examples/sign.rs @@ -29,7 +29,7 @@ fn main() { // Compose a writer stack corresponding to the output format and // packet structure we want. First, we want the output to be // ASCII armored. - let sink = armor::Writer::new(io::stdout(), armor::Kind::Message, &[][..]) + let sink = armor::Writer::new(io::stdout(), armor::Kind::Message, &[]) .expect("Failed to create an armored writer."); // Stream an OpenPGP message. diff --git a/openpgp/examples/wrap-literal.rs b/openpgp/examples/wrap-literal.rs index 9d9560e3..335bf307 100644 --- a/openpgp/examples/wrap-literal.rs +++ b/openpgp/examples/wrap-literal.rs @@ -21,7 +21,7 @@ fn main() { // Compose a writer stack corresponding to the output format and // packet structure we want. First, we want the output to be // ASCII armored. - let sink = armor::Writer::new(io::stdout(), armor::Kind::Message, &[][..]) + let sink = armor::Writer::new(io::stdout(), armor::Kind::Message, &[]) .expect("Failed to create armored writer."); // Stream an OpenPGP message. 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, |