summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--buffered-reader/src/generic.rs2
-rw-r--r--buffered-reader/src/lib.rs2
-rw-r--r--buffered-reader/src/memory.rs2
-rw-r--r--openpgp/src/armor.rs2
-rw-r--r--openpgp/src/constants.rs38
-rw-r--r--openpgp/src/ecdh.rs2
-rw-r--r--openpgp/src/mpis.rs4
-rw-r--r--openpgp/src/packet_pile.rs2
-rw-r--r--openpgp/src/parse/packet_parser_builder.rs2
-rw-r--r--openpgp/src/parse/parse.rs2
-rw-r--r--openpgp/src/parse/partial_body.rs2
-rw-r--r--openpgp/src/pkesk.rs2
-rw-r--r--openpgp/src/s2k.rs20
-rw-r--r--openpgp/src/skesk.rs2
-rw-r--r--openpgp/src/symmetric.rs4
-rw-r--r--openpgp/src/tag.rs2
-rw-r--r--store/src/lib.rs2
17 files changed, 46 insertions, 46 deletions
diff --git a/buffered-reader/src/generic.rs b/buffered-reader/src/generic.rs
index f2f11cd6..b6fe7aa2 100644
--- a/buffered-reader/src/generic.rs
+++ b/buffered-reader/src/generic.rs
@@ -1,7 +1,7 @@
use std::io;
use std::fmt;
use std::cmp;
-use std::io::{Error,ErrorKind};
+use std::io::{Error, ErrorKind};
use super::*;
diff --git a/buffered-reader/src/lib.rs b/buffered-reader/src/lib.rs
index 9619e0de..945de531 100644
--- a/buffered-reader/src/lib.rs
+++ b/buffered-reader/src/lib.rs
@@ -6,7 +6,7 @@ extern crate flate2;
extern crate bzip2;
use std::io;
-use std::io::{Error,ErrorKind};
+use std::io::{Error, ErrorKind};
use std::cmp;
use std::fmt;
diff --git a/buffered-reader/src/memory.rs b/buffered-reader/src/memory.rs
index 83de83a8..c2fd8781 100644
--- a/buffered-reader/src/memory.rs
+++ b/buffered-reader/src/memory.rs
@@ -2,7 +2,7 @@ use std::io;
use std::fmt;
use std::cmp;
-use std::io::{Error,ErrorKind};
+use std::io::{Error, ErrorKind};
use super::*;
diff --git a/openpgp/src/armor.rs b/openpgp/src/armor.rs
index eb1e6a53..9d44f013 100644
--- a/openpgp/src/armor.rs
+++ b/openpgp/src/armor.rs
@@ -24,7 +24,7 @@
//!
//! # Example
//!
-//! ```rust,no_run
+//! ```rust, no_run
//! use std::fs::File;
//! use openpgp::armor::{Reader, Kind};
//!
diff --git a/openpgp/src/constants.rs b/openpgp/src/constants.rs
index 7cee1509..4fdbe292 100644
--- a/openpgp/src/constants.rs
+++ b/openpgp/src/constants.rs
@@ -19,7 +19,7 @@ use Result;
/// [Section 5 of RFC 6637]: https://tools.ietf.org/html/rfc6637
///
/// The values correspond to the serialized format.
-#[derive(Clone,Copy,PartialEq,Eq,Debug,PartialOrd,Ord)]
+#[derive(Clone, Copy, PartialEq, Eq, Debug, PartialOrd, Ord)]
pub enum PublicKeyAlgorithm {
/// RSA (Encrypt or Sign)
RSAEncryptSign,
@@ -97,9 +97,9 @@ impl fmt::Display for PublicKeyAlgorithm {
ECDH => f.write_str("ECDH public key algorithm"),
EdDSA => f.write_str("EdDSA Edwards-curve Digital Signature Algorithm)"),
Private(u) =>
- f.write_fmt(format_args!("Private/Experimental public key algorithm {}",u)),
+ f.write_fmt(format_args!("Private/Experimental public key algorithm {}", u)),
Unknown(u) =>
- f.write_fmt(format_args!("Unknown public key algorithm {}",u)),
+ f.write_fmt(format_args!("Unknown public key algorithm {}", u)),
}
}
}
@@ -245,7 +245,7 @@ impl Arbitrary for Curve {
/// symbolic one.
///
/// [`SymmetricAlgorithm::from`]: https://doc.rust-lang.org/std/convert/trait.From.html
-#[derive(Clone,Copy,PartialEq,Eq,Debug,PartialOrd,Ord)]
+#[derive(Clone, Copy, PartialEq, Eq, Debug, PartialOrd, Ord)]
pub enum SymmetricAlgorithm {
/// Null encryption.
Unencrypted,
@@ -347,9 +347,9 @@ impl fmt::Display for SymmetricAlgorithm {
SymmetricAlgorithm::Camellia256 =>
f.write_str("Camellia with 256-bit key"),
SymmetricAlgorithm::Private(u) =>
- f.write_fmt(format_args!("Private/Experimental symmetric key algorithm {}",u)),
+ f.write_fmt(format_args!("Private/Experimental symmetric key algorithm {}", u)),
SymmetricAlgorithm::Unknown(u) =>
- f.write_fmt(format_args!("Unknown symmetric key algorithm {}",u)),
+ f.write_fmt(format_args!("Unknown symmetric key algorithm {}", u)),
}
}
}
@@ -365,7 +365,7 @@ impl Arbitrary for SymmetricAlgorithm {
/// [Section 9.3 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-9.3
///
/// The values correspond to the serialized format.
-#[derive(Clone,Copy,PartialEq,Eq,Debug,PartialOrd,Ord)]
+#[derive(Clone, Copy, PartialEq, Eq, Debug, PartialOrd, Ord)]
pub enum CompressionAlgorithm {
/// Null compression.
Uncompressed,
@@ -415,9 +415,9 @@ impl fmt::Display for CompressionAlgorithm {
CompressionAlgorithm::Zlib => f.write_str("ZLIB"),
CompressionAlgorithm::BZip2 => f.write_str("BZip2"),
CompressionAlgorithm::Private(u) =>
- f.write_fmt(format_args!("Private/Experimental compression algorithm {}",u)),
+ f.write_fmt(format_args!("Private/Experimental compression algorithm {}", u)),
CompressionAlgorithm::Unknown(u) =>
- f.write_fmt(format_args!("Unknown comppression algorithm {}",u)),
+ f.write_fmt(format_args!("Unknown comppression algorithm {}", u)),
}
}
}
@@ -433,7 +433,7 @@ impl Arbitrary for CompressionAlgorithm {
/// [Section 9.4 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-9.4
///
/// The values correspond to the serialized format.
-#[derive(Clone,Copy,PartialEq,Eq,Debug,PartialOrd,Ord)]
+#[derive(Clone, Copy, PartialEq, Eq, Debug, PartialOrd, Ord)]
pub enum HashAlgorithm {
/// Rivest et.al. message digest 5.
MD5,
@@ -522,9 +522,9 @@ impl fmt::Display for HashAlgorithm {
HashAlgorithm::SHA512 => f.write_str("SHA512"),
HashAlgorithm::SHA224 => f.write_str("SHA224"),
HashAlgorithm::Private(u) =>
- f.write_fmt(format_args!("Private/Experimental hash algorithm {}",u)),
+ f.write_fmt(format_args!("Private/Experimental hash algorithm {}", u)),
HashAlgorithm::Unknown(u) =>
- f.write_fmt(format_args!("Unknown hash algorithm {}",u)),
+ f.write_fmt(format_args!("Unknown hash algorithm {}", u)),
}
}
}
@@ -540,7 +540,7 @@ impl Arbitrary for HashAlgorithm {
/// [Section 5.2.1 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-5.2.1
///
/// The values correspond to the serialized format.
-#[derive(Clone,Copy,PartialEq,Eq,Debug)]
+#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum SignatureType {
/// Signature over a binary document.
Binary,
@@ -661,7 +661,7 @@ impl fmt::Display for SignatureType {
SignatureType::Confirmation =>
f.write_str("Confirmation"),
SignatureType::Unknown(u) =>
- f.write_fmt(format_args!("Unknown signature type {}",u)),
+ f.write_fmt(format_args!("Unknown signature type {}", u)),
}
}
}
@@ -685,7 +685,7 @@ mod tests {
quickcheck! {
fn comp_display(comp: CompressionAlgorithm) -> bool {
- let s = format!("{}",comp);
+ let s = format!("{}", comp);
!s.is_empty()
}
}
@@ -710,7 +710,7 @@ mod tests {
quickcheck! {
fn sym_display(sym: SymmetricAlgorithm) -> bool {
- let s = format!("{}",sym);
+ let s = format!("{}", sym);
!s.is_empty()
}
}
@@ -737,7 +737,7 @@ mod tests {
quickcheck! {
fn pk_display(pk: PublicKeyAlgorithm) -> bool {
- let s = format!("{}",pk);
+ let s = format!("{}", pk);
!s.is_empty()
}
}
@@ -789,7 +789,7 @@ mod tests {
match hash {
HashAlgorithm::Private(_) | HashAlgorithm::Unknown(_) => true,
hash => {
- let s = format!("{}",hash);
+ let s = format!("{}", hash);
hash == HashAlgorithm::from_str(&s).unwrap()
}
}
@@ -798,7 +798,7 @@ mod tests {
quickcheck! {
fn hash_display(hash: HashAlgorithm) -> bool {
- let s = format!("{}",hash);
+ let s = format!("{}", hash);
!s.is_empty()
}
}
diff --git a/openpgp/src/ecdh.rs b/openpgp/src/ecdh.rs
index d9fab2bf..13fb8bb3 100644
--- a/openpgp/src/ecdh.rs
+++ b/openpgp/src/ecdh.rs
@@ -113,7 +113,7 @@ pub fn unwrap_session_key(recipient: &Key, recipient_sec: &MPIs,
&mut r_reversed.reverse();
let r = &r_reversed;
- // Compute the shared point S = rV = rvG, where (r,R)
+ // Compute the shared point S = rV = rvG, where (r, R)
// is the recipient's key pair.
#[allow(non_snake_case)]
let mut S = [0; curve25519::CURVE25519_SIZE];
diff --git a/openpgp/src/mpis.rs b/openpgp/src/mpis.rs
index 80addfa1..8e2ae717 100644
--- a/openpgp/src/mpis.rs
+++ b/openpgp/src/mpis.rs
@@ -54,7 +54,7 @@ impl MPI {
impl fmt::Debug for MPI {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_fmt(format_args!(
- "{} bits: {}",self.bits, ::to_hex(&*self.value, true)))
+ "{} bits: {}", self.bits, ::to_hex(&*self.value, true)))
}
}
@@ -260,7 +260,7 @@ impl MPIs {
&ECDSASecretKey { ref scalar } => 2 + scalar.value.len(),
&ECDSASignature { ref r, ref s } => 2 + r.value.len() + 2 + s.value.len(),
- &ECDHPublicKey { ref curve, ref q,.. } =>
+ &ECDHPublicKey { ref curve, ref q, .. } =>
// one length octet plus the ASN.1 OID
1 + curve.oid().len() +
2 + q.value.len() +
diff --git a/openpgp/src/packet_pile.rs b/openpgp/src/packet_pile.rs
index 65ca1b79..a286307b 100644
--- a/openpgp/src/packet_pile.rs
+++ b/openpgp/src/packet_pile.rs
@@ -410,7 +410,7 @@ impl<'a> PacketParserBuilder<'a> {
/// ```rust
/// # use openpgp::Result;
/// # use openpgp::PacketPile;
- /// # use openpgp::parse::{PacketParser,PacketParserBuilder};
+ /// # use openpgp::parse::{PacketParser, PacketParserBuilder};
/// # f(include_bytes!("../tests/data/messages/public-key.gpg"));
/// #
/// # fn f(message_data: &[u8]) -> Result<PacketPile> {
diff --git a/openpgp/src/parse/packet_parser_builder.rs b/openpgp/src/parse/packet_parser_builder.rs
index efc7e49e..3fa6a68c 100644
--- a/openpgp/src/parse/packet_parser_builder.rs
+++ b/openpgp/src/parse/packet_parser_builder.rs
@@ -88,7 +88,7 @@ impl<'a> PacketParserBuilder<'a> {
///
/// ```rust
/// # use openpgp::Result;
- /// # use openpgp::parse::{PacketParser,PacketParserBuilder};
+ /// # use openpgp::parse::{PacketParser, PacketParserBuilder};
/// # f(include_bytes!("../../tests/data/messages/public-key.gpg"));
/// #
/// # fn f(message_data: &[u8])
diff --git a/openpgp/src/parse/parse.rs b/openpgp/src/parse/parse.rs
index d0195b92..65683d40 100644
--- a/openpgp/src/parse/parse.rs
+++ b/openpgp/src/parse/parse.rs
@@ -631,7 +631,7 @@ impl S2K {
Ok(ret)
}
- fn read_salt<'a,>(php: &mut PacketHeaderParser<'a>) -> Result<[u8; 8]> {
+ fn read_salt<'a>(php: &mut PacketHeaderParser<'a>) -> Result<[u8; 8]> {
let mut b = [0u8; 8];
b.copy_from_slice(&php.parse_bytes("s2k_salt", 8)?);
diff --git a/openpgp/src/parse/partial_body.rs b/openpgp/src/parse/partial_body.rs
index 91edb1fa..6d46f0dd 100644
--- a/openpgp/src/parse/partial_body.rs
+++ b/openpgp/src/parse/partial_body.rs
@@ -1,7 +1,7 @@
use std;
use std::cmp;
use std::io;
-use std::io::{Error,ErrorKind};
+use std::io::{Error, ErrorKind};
use buffered_reader::{buffered_reader_generic_read_impl, BufferedReader};
use BodyLength;
diff --git a/openpgp/src/pkesk.rs b/openpgp/src/pkesk.rs
index e86a73be..2eadcfe3 100644
--- a/openpgp/src/pkesk.rs
+++ b/openpgp/src/pkesk.rs
@@ -104,7 +104,7 @@ impl PKESK {
(self.pk_algo, &recipient.mpis, recipient_sec, &self.esk)
{
(RSAEncryptSign, &RSAPublicKey{ ref e, ref n },
- &RSASecretKey{ ref p, ref q, ref d,.. },
+ &RSASecretKey{ ref p, ref q, ref d, .. },
&RSACiphertext{ ref c }) => {
let public = rsa::PublicKey::new(&n.value, &e.value)?;
let secret = rsa::PrivateKey::new(&d.value, &p.value,
diff --git a/openpgp/src/s2k.rs b/openpgp/src/s2k.rs
index f1b064a8..d12d922e 100644
--- a/openpgp/src/s2k.rs
+++ b/openpgp/src/s2k.rs
@@ -13,7 +13,7 @@ use HashAlgorithm;
use std::fmt;
use nettle::{Hash, Yarrow};
-use quickcheck::{Arbitrary,Gen};
+use quickcheck::{Arbitrary, Gen};
/// String-to-Key (S2K) specifiers.
///
@@ -22,7 +22,7 @@ use quickcheck::{Arbitrary,Gen};
/// [Section 3.7 of RFC 4880].
///
/// [Section 3.7 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-3.7
-#[derive(Clone,Copy,PartialEq,Eq,Debug)]
+#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum S2K {
/// Simply hashes the password.
Simple {
@@ -69,8 +69,8 @@ impl S2K {
pub fn derive_key(&self, string: &[u8], key_size: usize)
-> Result<Vec<u8>> {
match self {
- &S2K::Simple { hash } | &S2K::Salted { hash,.. }
- | &S2K::Iterated { hash,.. } => {
+ &S2K::Simple { hash } | &S2K::Salted { hash, .. }
+ | &S2K::Iterated { hash, .. } => {
let mut hash = hash.context()?;
// If the digest length is shorter than the key length,
@@ -88,7 +88,7 @@ impl S2K {
&S2K::Simple { .. } => {
hash.update(string);
}
- &S2K::Salted { ref salt,.. } => {
+ &S2K::Salted { ref salt, .. } => {
hash.update(salt);
hash.update(string);
}
@@ -176,7 +176,7 @@ impl S2K {
// eeee.mmmm -> (16 + mmmm) * 2^(6 + e)
let msb = 32 - iters.leading_zeros();
- let (mantissa_mask,tail_mask) = match msb {
+ let (mantissa_mask, tail_mask) = match msb {
0...10 => {
return Err(Error::MalformedPacket(
format!("S2K: cannot encode iteration count of {}",
@@ -218,7 +218,7 @@ impl fmt::Display for S2K {
}
S2K::Iterated{ hash, salt, iterations, } => {
f.write_fmt(
- format_args!("Iterated and Salted S2K with {},\
+ format_args!("Iterated and Salted S2K with {}, \
salt {:x}{:x}{:x}{:x}{:x}{:x}{:x}{:x} and {} iterations",
hash,
salt[0], salt[1], salt[2], salt[3],
@@ -226,8 +226,8 @@ impl fmt::Display for S2K {
iterations))
}
S2K::Private(u) =>
- f.write_fmt(format_args!("Private/Experimental S2K {}",u)),
- S2K::Unknown(u) => f.write_fmt(format_args!("Unknown S2K {}",u)),
+ f.write_fmt(format_args!("Private/Experimental S2K {}", u)),
+ S2K::Unknown(u) => f.write_fmt(format_args!("Unknown S2K {}", u)),
}
}
}
@@ -417,7 +417,7 @@ mod tests {
quickcheck! {
fn s2k_display(s2k: S2K) -> bool {
- let s = format!("{}",s2k);
+ let s = format!("{}", s2k);
!s.is_empty()
}
}
diff --git a/openpgp/src/skesk.rs b/openpgp/src/skesk.rs
index 0d5e70b2..68569a5c 100644
--- a/openpgp/src/skesk.rs
+++ b/openpgp/src/skesk.rs
@@ -90,7 +90,7 @@ impl SKESK {
let mut plain = vec![0u8; self.esk.len()];
let cipher = &self.esk[..];
- for (pl,ct) in plain[..].chunks_mut(blk_sz).zip(cipher.chunks(blk_sz)) {
+ for (pl, ct) in plain[..].chunks_mut(blk_sz).zip(cipher.chunks(blk_sz)) {
dec.decrypt(&mut iv[..], pl, ct);
}
diff --git a/openpgp/src/symmetric.rs b/openpgp/src/symmetric.rs
index ea832007..9063a600 100644
--- a/openpgp/src/symmetric.rs
+++ b/openpgp/src/symmetric.rs
@@ -53,7 +53,7 @@ impl SymmetricAlgorithm {
/// Creates a Nettle context for encrypting in CFB mode.
pub fn make_encrypt_cfb(self, key: &[u8]) -> Result<Box<Mode>> {
- use nettle::{mode,cipher};
+ use nettle::{mode, cipher};
match self {
SymmetricAlgorithm::TripleDES =>
Ok(Box::new(
@@ -88,7 +88,7 @@ impl SymmetricAlgorithm {
/// Creates a Nettle context for decrypting in CFB mode.
pub fn make_decrypt_cfb(self, key: &[u8]) -> Result<Box<Mode>> {
- use nettle::{mode,cipher};
+ use nettle::{mode, cipher};
match self {
SymmetricAlgorithm::TripleDES =>
Ok(Box::new(
diff --git a/openpgp/src/tag.rs b/openpgp/src/tag.rs
index 1c5f9809..8c05e385 100644
--- a/openpgp/src/tag.rs
+++ b/openpgp/src/tag.rs
@@ -173,7 +173,7 @@ mod tests {
quickcheck! {
fn display(tag: Tag) -> bool {
- let s = format!("{}",tag);
+ let s = format!("{}", tag);
!s.is_empty()
}
}
diff --git a/store/src/lib.rs b/store/src/lib.rs
index 295f16ea..fb8d3d37 100644
--- a/store/src/lib.rs
+++ b/store/src/lib.rs
@@ -784,7 +784,7 @@ impl Log {
match self.status {
Ok(ref m) => format!(
- "{}: {}: {}", timestamp, self.slug,m),
+ "{}: {}: {}", timestamp, self.slug, m),
Err((ref m, ref e)) => format!(
"{}: {}: {}: {}", timestamp, self.slug, m, e),
}