From b5bb8de4f2bd18735346a6062a13d95bcf82bdee Mon Sep 17 00:00:00 2001 From: johnthagen Date: Tue, 3 Oct 2017 17:44:02 -0400 Subject: Convert try! usage to ? --- openssl/src/ssl/error.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'openssl/src/ssl/error.rs') diff --git a/openssl/src/ssl/error.rs b/openssl/src/ssl/error.rs index 74782d7a..db78e2c8 100644 --- a/openssl/src/ssl/error.rs +++ b/openssl/src/ssl/error.rs @@ -28,7 +28,7 @@ pub enum Error { impl fmt::Display for Error { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - try!(fmt.write_str(self.description())); + fmt.write_str(self.description())?; if let Some(err) = self.cause() { write!(fmt, ": {}", err) } else { @@ -98,14 +98,14 @@ impl StdError for HandshakeError { impl fmt::Display for HandshakeError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(f.write_str(StdError::description(self))); + f.write_str(StdError::description(self))?; match *self { - HandshakeError::SetupFailure(ref e) => try!(write!(f, ": {}", e)), + HandshakeError::SetupFailure(ref e) => write!(f, ": {}", e)?, HandshakeError::Failure(ref s) | HandshakeError::Interrupted(ref s) => { - try!(write!(f, ": {}", s.error())); + write!(f, ": {}", s.error())?; if let Some(err) = s.ssl().verify_result() { - try!(write!(f, ": {}", err)); + write!(f, ": {}", err)?; } } } -- cgit v1.2.3