summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWiktor Kwapisiewicz <wiktor@metacode.biz>2020-03-25 12:19:35 +0100
committerWiktor Kwapisiewicz <wiktor@metacode.biz>2020-03-26 18:33:21 +0100
commit70a96487b25557c3b1ffcba4b61cc1140e76935a (patch)
tree3846c7680a75047b81fe3b8307da47d4a4b0c080
parent89337646884b59c894329432eea960be4b3e335e (diff)
Remove redundant field names.
-rw-r--r--autocrypt/src/lib.rs6
-rw-r--r--buffered-reader/src/dup.rs4
-rw-r--r--buffered-reader/src/eof.rs2
-rw-r--r--buffered-reader/src/file_unix.rs4
-rw-r--r--buffered-reader/src/generic.rs2
-rw-r--r--buffered-reader/src/limitor.rs6
-rw-r--r--buffered-reader/src/memory.rs4
-rw-r--r--buffered-reader/src/reserve.rs6
-rw-r--r--ffi/src/store.rs4
-rw-r--r--guide/src/chapter_02.md8
-rw-r--r--net/src/lib.rs2
-rw-r--r--openpgp-ffi/src/parse/stream.rs2
-rw-r--r--openpgp/examples/decrypt-with.rs2
-rw-r--r--openpgp/src/armor.rs4
-rw-r--r--openpgp/src/cert/builder.rs2
-rw-r--r--openpgp/src/cert/component_iter.rs2
-rw-r--r--openpgp/src/cert/key_amalgamation.rs4
-rw-r--r--openpgp/src/cert/keyiter.rs2
-rw-r--r--openpgp/src/cert/mod.rs2
-rw-r--r--openpgp/src/crypto/aead.rs16
-rw-r--r--openpgp/src/crypto/asymmetric.rs4
-rw-r--r--openpgp/src/crypto/hash.rs6
-rw-r--r--openpgp/src/crypto/mpis.rs2
-rw-r--r--openpgp/src/crypto/s2k.rs2
-rw-r--r--openpgp/src/crypto/symmetric.rs12
-rw-r--r--openpgp/src/fmt.rs2
-rw-r--r--openpgp/src/message/mod.rs2
-rw-r--r--openpgp/src/packet/aed.rs8
-rw-r--r--openpgp/src/packet/compressed_data.rs2
-rw-r--r--openpgp/src/packet/header/ctb.rs6
-rw-r--r--openpgp/src/packet/key/mod.rs14
-rw-r--r--openpgp/src/packet/literal.rs2
-rw-r--r--openpgp/src/packet/one_pass_sig.rs4
-rw-r--r--openpgp/src/packet/pkesk.rs6
-rw-r--r--openpgp/src/packet/signature/mod.rs16
-rw-r--r--openpgp/src/packet/signature/subpacket.rs14
-rw-r--r--openpgp/src/packet/skesk.rs4
-rw-r--r--openpgp/src/packet/unknown.rs4
-rw-r--r--openpgp/src/packet/userid/mod.rs28
-rw-r--r--openpgp/src/packet_pile.rs2
-rw-r--r--openpgp/src/parse.rs4
-rw-r--r--openpgp/src/parse/hashed_reader.rs4
-rw-r--r--openpgp/src/parse/map.rs2
-rw-r--r--openpgp/src/parse/mpis.rs6
-rw-r--r--openpgp/src/parse/partial_body.rs8
-rw-r--r--openpgp/src/parse/stream.rs20
-rw-r--r--openpgp/src/policy.rs4
-rw-r--r--openpgp/src/serialize/cert.rs2
-rw-r--r--openpgp/src/serialize/cert_armored.rs2
-rw-r--r--openpgp/src/serialize/partial_body.rs6
-rw-r--r--openpgp/src/serialize/stream.rs6
-rw-r--r--openpgp/src/serialize/writer/mod.rs6
-rw-r--r--openpgp/src/types/features.rs2
53 files changed, 148 insertions, 148 deletions
diff --git a/autocrypt/src/lib.rs b/autocrypt/src/lib.rs
index 1aa84cc0..6caa5a21 100644
--- a/autocrypt/src/lib.rs
+++ b/autocrypt/src/lib.rs
@@ -272,7 +272,7 @@ impl AutocryptHeaders {
} else {
key
},
- value: value,
+ value,
});
}
@@ -346,7 +346,7 @@ impl AutocryptSetupMessage {
passcode: None,
passcode_format: None,
passcode_begin: None,
- cert: cert,
+ cert,
}
}
@@ -769,7 +769,7 @@ impl<'a> AutocryptSetupMessageParser<'a> {
passcode: self.passcode,
passcode_format: self.passcode_format,
passcode_begin: self.passcode_begin,
- cert: cert,
+ cert,
})
}
}
diff --git a/buffered-reader/src/dup.rs b/buffered-reader/src/dup.rs
index 7870050b..d2573dce 100644
--- a/buffered-reader/src/dup.rs
+++ b/buffered-reader/src/dup.rs
@@ -52,9 +52,9 @@ impl<T: BufferedReader<C>, C> Dup<T, C> {
/// `cookie_mut` methods, and set using the `cookie_set` method.
pub fn with_cookie(reader: T, cookie: C) -> Self {
Dup {
- reader: reader,
+ reader,
cursor: 0,
- cookie: cookie,
+ cookie,
}
}
diff --git a/buffered-reader/src/eof.rs b/buffered-reader/src/eof.rs
index 928cd518..41d3d763 100644
--- a/buffered-reader/src/eof.rs
+++ b/buffered-reader/src/eof.rs
@@ -35,7 +35,7 @@ impl<C> EOF<C> {
/// Instantiates a new `EOF` with a cookie.
pub fn with_cookie(cookie: C) -> Self {
EOF {
- cookie: cookie,
+ cookie,
}
}
}
diff --git a/buffered-reader/src/file_unix.rs b/buffered-reader/src/file_unix.rs
index 69065296..2162f7d1 100644
--- a/buffered-reader/src/file_unix.rs
+++ b/buffered-reader/src/file_unix.rs
@@ -144,8 +144,8 @@ impl<'a, C> File<'a, C> {
Ok(File(
Imp::MMAP {
- addr: addr,
- length: length,
+ addr,
+ length,
reader: Memory::with_cookie(slice, cookie),
}
))
diff --git a/buffered-reader/src/generic.rs b/buffered-reader/src/generic.rs
index bd5a21c6..1ab87e50 100644
--- a/buffered-reader/src/generic.rs
+++ b/buffered-reader/src/generic.rs
@@ -68,7 +68,7 @@ impl<T: io::Read, C> Generic<T, C> {
if let Some(s) = preferred_chunk_size { s }
else { DEFAULT_BUF_SIZE },
reader: Box::new(reader),
- cookie: cookie,
+ cookie,
}
}
diff --git a/buffered-reader/src/limitor.rs b/buffered-reader/src/limitor.rs
index 65478194..a8588032 100644
--- a/buffered-reader/src/limitor.rs
+++ b/buffered-reader/src/limitor.rs
@@ -45,9 +45,9 @@ impl<T: BufferedReader<C>, C> Limitor<T, C> {
pub fn with_cookie(reader: T, limit: u64, cookie: C)
-> Limitor<T, C> {
Limitor {
- reader: reader,
- limit: limit,
- cookie: cookie,
+ reader,
+ limit,
+ cookie,
}
}
}
diff --git a/buffered-reader/src/memory.rs b/buffered-reader/src/memory.rs
index 2ecf96a3..7647f4ea 100644
--- a/buffered-reader/src/memory.rs
+++ b/buffered-reader/src/memory.rs
@@ -52,9 +52,9 @@ impl<'a, C> Memory<'a, C> {
/// `cookie_mut` methods, and set using the `cookie_set` method.
pub fn with_cookie(buffer: &'a [u8], cookie: C) -> Self {
Memory {
- buffer: buffer,
+ buffer,
cursor: 0,
- cookie: cookie,
+ cookie,
}
}
diff --git a/buffered-reader/src/reserve.rs b/buffered-reader/src/reserve.rs
index 4c2ec047..3d0364d5 100644
--- a/buffered-reader/src/reserve.rs
+++ b/buffered-reader/src/reserve.rs
@@ -49,9 +49,9 @@ impl<T: BufferedReader<C>, C> Reserve<T, C> {
pub fn with_cookie(reader: T, reserve: usize, cookie: C)
-> Reserve<T, C> {
Reserve {
- reader: reader,
- reserve: reserve,
- cookie: cookie,
+ reader,
+ reserve,
+ cookie,
}
}
}
diff --git a/ffi/src/store.rs b/ffi/src/store.rs
index af71d350..5e6dce3d 100644
--- a/ffi/src/store.rs
+++ b/ffi/src/store.rs
@@ -165,8 +165,8 @@ fn sq_log_iter_next(iter: *mut LogIter) -> *mut Log {
binding: maybe_box_raw!(e.binding),
key: maybe_box_raw!(e.key),
slug: ffi_return_string!(&e.slug),
- status: status,
- error: error,
+ status,
+ error,
})
},
None => ptr::null_mut(),
diff --git a/guide/src/chapter_02.md b/guide/src/chapter_02.md
index 3b95e516..3553df3f 100644
--- a/guide/src/chapter_02.md
+++ b/guide/src/chapter_02.md
@@ -93,7 +93,7 @@ fn main() {
# // Make a helper that that feeds the recipient's secret key to the
# // decryptor.
# let helper = Helper {
-# policy: policy,
+# policy,
# secret: recipient,
# };
#
@@ -244,7 +244,7 @@ fn generate() -> openpgp::Result<openpgp::Cert> {
# // Make a helper that that feeds the recipient's secret key to the
# // decryptor.
# let helper = Helper {
-# policy: policy,
+# policy,
# secret: recipient,
# };
#
@@ -395,7 +395,7 @@ fn encrypt(policy: &dyn Policy,
# // Make a helper that that feeds the recipient's secret key to the
# // decryptor.
# let helper = Helper {
-# policy: policy,
+# policy,
# secret: recipient,
# };
#
@@ -560,7 +560,7 @@ fn decrypt(policy: &dyn Policy,
// Make a helper that that feeds the recipient's secret key to the
// decryptor.
let helper = Helper {
- policy: policy,
+ policy,
secret: recipient,
};
diff --git a/net/src/lib.rs b/net/src/lib.rs
index 5f194550..4e7c4655 100644
--- a/net/src/lib.rs
+++ b/net/src/lib.rs
@@ -151,7 +151,7 @@ impl KeyServer {
_ => unreachable!(),
}.unwrap()).parse()?;
- Ok(KeyServer{client: client, uri: uri})
+ Ok(KeyServer{client, uri})
}
/// Retrieves the key with the given `keyid`.
diff --git a/openpgp-ffi/src/parse/stream.rs b/openpgp-ffi/src/parse/stream.rs
index 996c5b58..71e9caba 100644
--- a/openpgp-ffi/src/parse/stream.rs
+++ b/openpgp-ffi/src/parse/stream.rs
@@ -443,7 +443,7 @@ impl VHelper {
VHelper {
get_public_keys_cb: get_public_keys,
check_signatures_cb: check_signatures,
- cookie: cookie,
+ cookie,
}
}
}
diff --git a/openpgp/examples/decrypt-with.rs b/openpgp/examples/decrypt-with.rs
index 5de69863..336a85b3 100644
--- a/openpgp/examples/decrypt-with.rs
+++ b/openpgp/examples/decrypt-with.rs
@@ -71,7 +71,7 @@ impl Helper {
}
Helper {
- keys: keys,
+ keys,
}
}
}
diff --git a/openpgp/src/armor.rs b/openpgp/src/armor.rs
index 6f11958b..372c6881 100644
--- a/openpgp/src/armor.rs
+++ b/openpgp/src/armor.rs
@@ -186,7 +186,7 @@ impl<W: Write> Writer<W> {
pub fn new(inner: W, kind: Kind, headers: &[(&str, &str)]) -> Result<Self> {
let mut w = Writer {
sink: Some(inner),
- kind: kind,
+ kind,
stash: Vec::<u8>::with_capacity(2),
column: 0,
crc: CRC::new(),
@@ -562,7 +562,7 @@ impl<'a> Reader<'a> {
Reader {
source: Box::new(buffered_reader::Generic::new(inner, None)),
kind: None,
- mode: mode,
+ mode,
buffer: Vec::<u8>::with_capacity(1024),
crc: CRC::new(),
expect_crc: None,
diff --git a/openpgp/src/cert/builder.rs b/openpgp/src/cert/builder.rs
index aac45a50..0362b323 100644
--- a/openpgp/src/cert/builder.rs
+++ b/openpgp/src/cert/builder.rs
@@ -249,7 +249,7 @@ impl CertBuilder {
C: Into<Option<CipherSuite>>,
{
self.subkeys.push(KeyBlueprint {
- flags: flags,
+ flags,
expiration: expiration.into(),
ciphersuite: cs.into(),
});
diff --git a/openpgp/src/cert/component_iter.rs b/openpgp/src/cert/component_iter.rs
index ca1eafb6..c0e82117 100644
--- a/openpgp/src/cert/component_iter.rs
+++ b/openpgp/src/cert/component_iter.rs
@@ -59,7 +59,7 @@ impl<'a, C> ComponentIter<'a, C> {
cert: self.cert,
iter: self.iter,
time: time.into().unwrap_or_else(SystemTime::now),
- policy: policy,
+ policy,
revoked: None,
}
}
diff --git a/openpgp/src/cert/key_amalgamation.rs b/openpgp/src/cert/key_amalgamation.rs
index 507a2afa..0e729e37 100644
--- a/openpgp/src/cert/key_amalgamation.rs
+++ b/openpgp/src/cert/key_amalgamation.rs
@@ -221,7 +221,7 @@ impl<'a, P> ValidateAmalgamation<'a, Key<P, key::UnspecifiedRole>>
policy: policy,
time: time,
},
- binding_signature: binding_signature,
+ binding_signature
};
policy.key(&vka)?;
Ok(ValidErasedKeyAmalgamation {
@@ -231,7 +231,7 @@ impl<'a, P> ValidateAmalgamation<'a, Key<P, key::UnspecifiedRole>>
primary: vka.ka.primary,
},
cert: vka.cert,
- binding_signature: binding_signature,
+ binding_signature,
})
} else {
Err(Error::NoBindingSignature(time).into())
diff --git a/openpgp/src/cert/keyiter.rs b/openpgp/src/cert/keyiter.rs
index 3e5e2ba7..0cfc3e23 100644
--- a/openpgp/src/cert/keyiter.rs
+++ b/openpgp/src/cert/keyiter.rs
@@ -416,7 +416,7 @@ impl<'a, P, R> KeyIter<'a, P, R>
primary: self.primary,
subkey_iter: self.subkey_iter,
- policy: policy,
+ policy,
time: time.into().unwrap_or_else(SystemTime::now),
// The filters.
diff --git a/openpgp/src/cert/mod.rs b/openpgp/src/cert/mod.rs
index 72cc54c9..5612e271 100644
--- a/openpgp/src/cert/mod.rs
+++ b/openpgp/src/cert/mod.rs
@@ -1364,7 +1364,7 @@ impl Cert {
Ok(ValidCert {
cert: self,
policy,
- time: time,
+ time,
})
}
}
diff --git a/openpgp/src/crypto/aead.rs b/openpgp/src/crypto/aead.rs
index 03d5c995..a79c7767 100644
--- a/openpgp/src/crypto/aead.rs
+++ b/openpgp/src/crypto/aead.rs
@@ -133,9 +133,9 @@ impl<'a> Decryptor<'a> {
-> Result<Self>
{
Ok(Decryptor {
- source: source,
- sym_algo: sym_algo,
- aead: aead,
+ source,
+ sym_algo,
+ aead,
key: key.clone(),
iv: Vec::from(iv).into_boxed_slice(),
ad: [
@@ -148,7 +148,7 @@ impl<'a> Decryptor<'a> {
0, 0, 0, 0, 0, 0, 0, 0,
],
digest_size: aead.digest_size()?,
- chunk_size: chunk_size,
+ chunk_size,
chunk_index: 0,
bytes_decrypted: 0,
buffer: Vec::with_capacity(chunk_size),
@@ -551,8 +551,8 @@ impl<W: io::Write> Encryptor<W> {
Ok(Encryptor {
inner: Some(sink),
- sym_algo: sym_algo,
- aead: aead,
+ sym_algo,
+ aead,
key: key.clone(),
iv: Vec::from(iv).into_boxed_slice(),
ad: [
@@ -565,11 +565,11 @@ impl<W: io::Write> Encryptor<W> {
0, 0, 0, 0, 0, 0, 0, 0,
],
digest_size: aead.digest_size()?,