diff options
author | Jonas Platte <jplatte+git@posteo.de> | 2020-12-31 19:45:38 +0100 |
---|---|---|
committer | Jonas Platte <jplatte+git@posteo.de> | 2021-01-01 04:11:48 +0100 |
commit | c13d0a21077127fbd4e2a84a2c8ec9830f0f3147 (patch) | |
tree | 995fcdd2e98ec890bc23d0c2f785928a98a62ab4 /openssl/src/x509 | |
parent | 0dc50fbfd45cbb84418a83dd4522f02b0b538f19 (diff) | |
download | rust-openssl-c13d0a21077127fbd4e2a84a2c8ec9830f0f3147.zip |
Use edition 2018 idioms and warn when they are not followed
This was mostly automated using `cargo fix --edition-idioms`.
Diffstat (limited to 'openssl/src/x509')
-rw-r--r-- | openssl/src/x509/extension.rs | 6 | ||||
-rw-r--r-- | openssl/src/x509/mod.rs | 16 |
2 files changed, 11 insertions, 11 deletions
diff --git a/openssl/src/x509/extension.rs b/openssl/src/x509/extension.rs index dd4899c8..efe70f2b 100644 --- a/openssl/src/x509/extension.rs +++ b/openssl/src/x509/extension.rs @@ -397,7 +397,7 @@ impl SubjectKeyIdentifier { } /// Return a `SubjectKeyIdentifier` extension as an `X509Extension`. - pub fn build(&self, ctx: &X509v3Context) -> Result<X509Extension, ErrorStack> { + pub fn build(&self, ctx: &X509v3Context<'_>) -> Result<X509Extension, ErrorStack> { let mut value = String::new(); let mut first = true; append(&mut value, &mut first, self.critical, "critical"); @@ -449,7 +449,7 @@ impl AuthorityKeyIdentifier { } /// Return a `AuthorityKeyIdentifier` extension as an `X509Extension`. - pub fn build(&self, ctx: &X509v3Context) -> Result<X509Extension, ErrorStack> { + pub fn build(&self, ctx: &X509v3Context<'_>) -> Result<X509Extension, ErrorStack> { let mut value = String::new(); let mut first = true; append(&mut value, &mut first, self.critical, "critical"); @@ -538,7 +538,7 @@ impl SubjectAlternativeName { } /// Return a `SubjectAlternativeName` extension as an `X509Extension`. - pub fn build(&self, ctx: &X509v3Context) -> Result<X509Extension, ErrorStack> { + pub fn build(&self, ctx: &X509v3Context<'_>) -> Result<X509Extension, ErrorStack> { let mut value = String::new(); let mut first = true; append(&mut value, &mut first, self.critical, "critical"); diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs index ad983fbd..b982be43 100644 --- a/openssl/src/x509/mod.rs +++ b/openssl/src/x509/mod.rs @@ -678,7 +678,7 @@ impl Clone for X509 { } impl fmt::Debug for X509 { - fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { let serial = match &self.serial_number().to_bn() { Ok(bn) => match bn.to_hex_str() { Ok(hex) => hex.to_string(), @@ -749,7 +749,7 @@ impl X509Extension { /// See the extension module for builder types which will construct certain common extensions. pub fn new( conf: Option<&ConfRef>, - context: Option<&X509v3Context>, + context: Option<&X509v3Context<'_>>, name: &str, value: &str, ) -> Result<X509Extension, ErrorStack> { @@ -775,7 +775,7 @@ impl X509Extension { /// See the extension module for builder types which will construct certain common extensions. pub fn new_nid( conf: Option<&ConfRef>, - context: Option<&X509v3Context>, + context: Option<&X509v3Context<'_>>, name: Nid, value: &str, ) -> Result<X509Extension, ErrorStack> { @@ -956,7 +956,7 @@ impl X509NameRef { } impl fmt::Debug for X509NameRef { - fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { formatter.debug_list().entries(self.entries()).finish() } } @@ -1036,7 +1036,7 @@ impl X509NameEntryRef { } impl fmt::Debug for X509NameEntryRef { - fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { formatter.write_fmt(format_args!("{:?} = {:?}", self.object(), self.data())) } } @@ -1283,7 +1283,7 @@ impl X509ReqRef { pub struct X509VerifyResult(c_int); impl fmt::Debug for X509VerifyResult { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct("X509VerifyResult") .field("code", &self.0) .field("error", &self.error_string()) @@ -1292,7 +1292,7 @@ impl fmt::Debug for X509VerifyResult { } impl fmt::Display for X509VerifyResult { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.write_str(self.error_string()) } } @@ -1397,7 +1397,7 @@ impl GeneralNameRef { } impl fmt::Debug for GeneralNameRef { - fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { if let Some(email) = self.email() { formatter.write_str(email) } else if let Some(dnsname) = self.dnsname() { |