Loading openssl/src/asn1.rs +17 −13 Original line number Diff line number Diff line Loading @@ -67,15 +67,17 @@ foreign_type_and_impl_send_sync! { impl fmt::Display for Asn1GeneralizedTimeRef { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { unsafe { match MemBio::new() { Err(_) => f.write_str(""), Ok(mem_bio) => match cvt(ffi::ASN1_GENERALIZEDTIME_print( let mem_bio = match MemBio::new() { Err(_) => return f.write_str(""), Ok(m) => m, }; let print_result = cvt(ffi::ASN1_GENERALIZEDTIME_print( mem_bio.as_ptr(), self.as_ptr(), )) { )); match print_result { Err(_) => f.write_str(""), Ok(_) => f.write_str(str::from_utf8_unchecked(mem_bio.get_buf())), }, } } } Loading Loading @@ -211,12 +213,14 @@ impl<'a> PartialOrd<Asn1Time> for &'a Asn1TimeRef { impl fmt::Display for Asn1TimeRef { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { unsafe { match MemBio::new() { Err(_) => f.write_str("error"), Ok(mem_bio) => match cvt(ffi::ASN1_TIME_print(mem_bio.as_ptr(), self.as_ptr())) { let mem_bio = match MemBio::new() { Err(_) => return f.write_str("error"), Ok(m) => m, }; let print_result = cvt(ffi::ASN1_TIME_print(mem_bio.as_ptr(), self.as_ptr())); match print_result { Err(_) => f.write_str("error"), Ok(_) => f.write_str(str::from_utf8_unchecked(mem_bio.get_buf())), }, } } } Loading openssl/src/pkey.rs +1 −3 Original line number Diff line number Diff line Loading @@ -301,9 +301,7 @@ impl<T> fmt::Debug for PKey<T> { Id::ED448 => "Ed448", _ => "unknown", }; fmt.debug_struct("public_key") .field("algorithm", &alg) .finish() fmt.debug_struct("PKey").field("algorithm", &alg).finish() // TODO: Print details for each specific type of key } } Loading openssl/src/x509/mod.rs +9 −11 Original line number Diff line number Diff line Loading @@ -1342,19 +1342,17 @@ impl GeneralNameRef { impl fmt::Debug for GeneralNameRef { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { if let Some(email) = self.email() { return formatter.write_str(email); } if let Some(dnsname) = self.dnsname() { return formatter.write_str(dnsname); } if let Some(uri) = self.uri() { return formatter.write_str(uri); } if let Some(ipaddress) = self.ipaddress() { formatter.write_str(email) } else if let Some(dnsname) = self.dnsname() { formatter.write_str(dnsname) } else if let Some(uri) = self.uri() { formatter.write_str(uri) } else if let Some(ipaddress) = self.ipaddress() { let result = String::from_utf8_lossy(ipaddress); return formatter.write_str(&result); formatter.write_str(&result) } else { formatter.write_str("(empty)") } Ok(()) } } Loading openssl/src/x509/tests.rs +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ fn test_debug() { ], not_before: Aug 14 17:00:03 2016 GMT, not_after: Aug 12 17:00:03 2026 GMT, public_key: public_key { public_key: PKey { algorithm: "RSA", }, }"#; Loading Loading
openssl/src/asn1.rs +17 −13 Original line number Diff line number Diff line Loading @@ -67,15 +67,17 @@ foreign_type_and_impl_send_sync! { impl fmt::Display for Asn1GeneralizedTimeRef { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { unsafe { match MemBio::new() { Err(_) => f.write_str(""), Ok(mem_bio) => match cvt(ffi::ASN1_GENERALIZEDTIME_print( let mem_bio = match MemBio::new() { Err(_) => return f.write_str(""), Ok(m) => m, }; let print_result = cvt(ffi::ASN1_GENERALIZEDTIME_print( mem_bio.as_ptr(), self.as_ptr(), )) { )); match print_result { Err(_) => f.write_str(""), Ok(_) => f.write_str(str::from_utf8_unchecked(mem_bio.get_buf())), }, } } } Loading Loading @@ -211,12 +213,14 @@ impl<'a> PartialOrd<Asn1Time> for &'a Asn1TimeRef { impl fmt::Display for Asn1TimeRef { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { unsafe { match MemBio::new() { Err(_) => f.write_str("error"), Ok(mem_bio) => match cvt(ffi::ASN1_TIME_print(mem_bio.as_ptr(), self.as_ptr())) { let mem_bio = match MemBio::new() { Err(_) => return f.write_str("error"), Ok(m) => m, }; let print_result = cvt(ffi::ASN1_TIME_print(mem_bio.as_ptr(), self.as_ptr())); match print_result { Err(_) => f.write_str("error"), Ok(_) => f.write_str(str::from_utf8_unchecked(mem_bio.get_buf())), }, } } } Loading
openssl/src/pkey.rs +1 −3 Original line number Diff line number Diff line Loading @@ -301,9 +301,7 @@ impl<T> fmt::Debug for PKey<T> { Id::ED448 => "Ed448", _ => "unknown", }; fmt.debug_struct("public_key") .field("algorithm", &alg) .finish() fmt.debug_struct("PKey").field("algorithm", &alg).finish() // TODO: Print details for each specific type of key } } Loading
openssl/src/x509/mod.rs +9 −11 Original line number Diff line number Diff line Loading @@ -1342,19 +1342,17 @@ impl GeneralNameRef { impl fmt::Debug for GeneralNameRef { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { if let Some(email) = self.email() { return formatter.write_str(email); } if let Some(dnsname) = self.dnsname() { return formatter.write_str(dnsname); } if let Some(uri) = self.uri() { return formatter.write_str(uri); } if let Some(ipaddress) = self.ipaddress() { formatter.write_str(email) } else if let Some(dnsname) = self.dnsname() { formatter.write_str(dnsname) } else if let Some(uri) = self.uri() { formatter.write_str(uri) } else if let Some(ipaddress) = self.ipaddress() { let result = String::from_utf8_lossy(ipaddress); return formatter.write_str(&result); formatter.write_str(&result) } else { formatter.write_str("(empty)") } Ok(()) } } Loading
openssl/src/x509/tests.rs +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ fn test_debug() { ], not_before: Aug 14 17:00:03 2016 GMT, not_after: Aug 12 17:00:03 2026 GMT, public_key: public_key { public_key: PKey { algorithm: "RSA", }, }"#; Loading