From e1ae4a79ada96a97f604d3f3f172b9b02a6da8bb Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Wed, 15 Apr 2020 06:32:33 +0200 Subject: openpgp: Rename field. - It's a bundle, not a binding. --- openpgp/src/cert/mod.rs | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'openpgp/src') diff --git a/openpgp/src/cert/mod.rs b/openpgp/src/cert/mod.rs index 0519a2fa..4ce0811b 100644 --- a/openpgp/src/cert/mod.rs +++ b/openpgp/src/cert/mod.rs @@ -243,7 +243,7 @@ impl fmt::Display for Cert { struct ComponentBundles where ComponentBundle: cmp::PartialEq { - bindings: Vec>, + bundles: Vec>, } impl Deref for ComponentBundles @@ -252,7 +252,7 @@ impl Deref for ComponentBundles type Target = Vec>; fn deref(&self) -> &Self::Target { - &self.bindings + &self.bundles } } @@ -260,7 +260,7 @@ impl DerefMut for ComponentBundles where ComponentBundle: cmp::PartialEq { fn deref_mut(&mut self) -> &mut Vec> { - &mut self.bindings + &mut self.bundles } } @@ -268,7 +268,7 @@ impl Into>> for ComponentBundles where ComponentBundle: cmp::PartialEq { fn into(self) -> Vec> { - self.bindings + self.bundles } } @@ -279,7 +279,7 @@ impl IntoIterator for ComponentBundles type IntoIter = std::vec::IntoIter; fn into_iter(self) -> Self::IntoIter { - self.bindings.into_iter() + self.bundles.into_iter() } } @@ -287,7 +287,7 @@ impl ComponentBundles where ComponentBundle: cmp::PartialEq { fn new() -> Self { - Self { bindings: vec![] } + Self { bundles: vec![] } } } @@ -304,13 +304,13 @@ impl ComponentBundles where F: Fn(&C, &C) -> Ordering, F2: Fn(&mut C, &mut C) { - // We dedup by component (not bindings!). To do this, we need - // to sort the bindings by their components. + // We dedup by component (not bundles!). To do this, we need + // to sort the bundles by their components. - self.bindings.sort_unstable_by( + self.bundles.sort_unstable_by( |a, b| cmp(&a.component, &b.component)); - self.bindings.dedup_by(|a, b| { + self.bundles.dedup_by(|a, b| { if cmp(&a.component, &b.component) == Ordering::Equal { // Merge. merge(&mut a.component, &mut b.component); @@ -328,7 +328,7 @@ impl ComponentBundles }); // And sort the certificates. - for b in self.bindings.iter_mut() { + for b in self.bundles.iter_mut() { b.sort_and_dedup(); } } @@ -339,24 +339,24 @@ impl ComponentBundles type KeyBundles = ComponentBundles>; /// A vector of subkeys and any associated signatures. -type SubkeyBindings = KeyBundles; +type SubkeyBundles = KeyBundles; /// A vector of key (primary or subkey, public or private) and any /// associated signatures. #[allow(dead_code)] -type GenericKeyBindings +type GenericKeyBundles = ComponentBundles>; -/// A vector of User ID bindings and any associated signatures. -type UserIDBindings = ComponentBundles; +/// A vector of User ID bundles and any associated signatures. +type UserIDBundles = ComponentBundles; -/// A vector of User Attribute bindings and any associated signatures. -type UserAttributeBindings = ComponentBundles; +/// A vector of User Attribute bundles and any associated signatures. +type UserAttributeBundles = ComponentBundles; /// A vector of unknown components and any associated signatures. /// /// Note: all signatures are stored as certifications. -type UnknownBindings = ComponentBundles; +type UnknownBundles = ComponentBundles; /// Returns the certificate holder's preferences. /// @@ -623,16 +623,16 @@ pub struct Cert { primary: PrimaryKeyBundle, pub(super) // doc-hack, see above - userids: UserIDBindings, + userids: UserIDBundles, pub(super) // doc-hack, see above - user_attributes: UserAttributeBindings, + user_attributes: UserAttributeBundles, pub(super) // doc-hack, see above - subkeys: SubkeyBindings, + subkeys: SubkeyBundles, // Unknown components, e.g., some UserAttribute++ packet from the // future. pub(super) // doc-hack, see above - unknowns: UnknownBindings, + unknowns: UnknownBundles, // Signatures that we couldn't find a place for. pub(super) // doc-hack, see above bad: Vec, -- cgit v1.2.3