diff options
author | Neal H. Walfield <neal@pep.foundation> | 2020-03-30 12:28:20 +0200 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2020-03-31 21:21:50 +0200 |
commit | 0693bee6431f2020ab9be8b85c59cbac3c5f9ffd (patch) | |
tree | 0326df73aab641cd7e1b2227d8669931058ebff3 /openpgp | |
parent | d270c7b59d0abd228a37149b53ac00617de6b858 (diff) |
openpgp: Import Result instead of using an absolute path.
- Don't use `crate::Result` directly. Import it and then use
`Result`.
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/src/cert/amalgamation.rs | 2 | ||||
-rw-r--r-- | openpgp/src/cert/components.rs | 3 | ||||
-rw-r--r-- | openpgp/src/fmt.rs | 6 |
3 files changed, 7 insertions, 4 deletions
diff --git a/openpgp/src/cert/amalgamation.rs b/openpgp/src/cert/amalgamation.rs index 16ad1175..0fc44d98 100644 --- a/openpgp/src/cert/amalgamation.rs +++ b/openpgp/src/cert/amalgamation.rs @@ -490,7 +490,7 @@ impl<'a, C> ComponentAmalgamation<'a, C> { /// Note: this function is not exported. Users of this interface /// should do: ca.with_policy(policy, time)?.binding_signature(). fn binding_signature<T>(&self, policy: &dyn Policy, time: T) - -> crate::Result<&'a Signature> + -> Result<&'a Signature> where T: Into<Option<time::SystemTime>> { let time = time.into().unwrap_or_else(SystemTime::now); diff --git a/openpgp/src/cert/components.rs b/openpgp/src/cert/components.rs index d94c585d..15227e5b 100644 --- a/openpgp/src/cert/components.rs +++ b/openpgp/src/cert/components.rs @@ -13,6 +13,7 @@ use crate::{ packet::Unknown, Packet, policy::Policy, + Result, }; use crate::types::{ RevocationType, @@ -113,7 +114,7 @@ impl<C> ComponentBundle<C> { /// signatures at time `t`, or there is one that did not match the /// given policy. pub fn binding_signature<T>(&self, policy: &dyn Policy, t: T) - -> crate::Result<&Signature> + -> Result<&Signature> where T: Into<Option<time::SystemTime>> { let t = t.into().unwrap_or_else(|| time::SystemTime::now()); diff --git a/openpgp/src/fmt.rs b/openpgp/src/fmt.rs index 6429c79f..586aa922 100644 --- a/openpgp/src/fmt.rs +++ b/openpgp/src/fmt.rs @@ -7,6 +7,8 @@ use crate::Result; pub mod hex { use std::io; + use crate::Result; + /// Encodes the given buffer as hexadecimal number. pub fn encode<B: AsRef<[u8]>>(buffer: B) -> String { super::to_hex(buffer.as_ref(), false) @@ -18,12 +20,12 @@ pub mod hex { } /// Decodes the given hexadecimal number. - pub fn decode<H: AsRef<str>>(hex: H) -> crate::Result<Vec<u8>> { + pub fn decode<H: AsRef<str>>(hex: H) -> Result<Vec<u8>> { super::from_hex(hex.as_ref(), false) } /// Decodes the given hexadecimal number, ignoring whitespace. - pub fn decode_pretty<H: AsRef<str>>(hex: H) -> crate::Result<Vec<u8>> { + pub fn decode_pretty<H: AsRef<str>>(hex: H) -> Result<Vec<u8>> { super::from_hex(hex.as_ref(), true) } |