diff options
| author | Andy Gauge <[email protected]> | 2017-10-09 12:10:04 -0700 |
|---|---|---|
| committer | Andy Gauge <[email protected]> | 2017-10-09 12:10:04 -0700 |
| commit | 2c7f0e7604e758d2ba7f6f39ab78d8302f484f65 (patch) | |
| tree | b939ebd1ac58177ad4e7a8f25b488f8fe41cd61f /openssl/src/error.rs | |
| parent | Begun DSA documentation (diff) | |
| parent | Merge pull request #753 from zsck/issue719 (diff) | |
| download | rust-openssl-2c7f0e7604e758d2ba7f6f39ab78d8302f484f65.tar.xz rust-openssl-2c7f0e7604e758d2ba7f6f39ab78d8302f484f65.zip | |
Merge branch 'master' of https://github.com/sfackler/rust-openssl
Diffstat (limited to 'openssl/src/error.rs')
| -rw-r--r-- | openssl/src/error.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/openssl/src/error.rs b/openssl/src/error.rs index 8612a996..9151c01b 100644 --- a/openssl/src/error.rs +++ b/openssl/src/error.rs @@ -35,9 +35,9 @@ impl fmt::Display for ErrorStack { let mut first = true; for err in &self.0 { if !first { - try!(fmt.write_str(", ")); + fmt.write_str(", ")?; } - try!(write!(fmt, "{}", err)); + write!(fmt, "{}", err)?; first = false; } Ok(()) @@ -197,18 +197,18 @@ impl fmt::Debug for Error { impl fmt::Display for Error { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - try!(write!(fmt, "error:{:08X}", self.code())); + write!(fmt, "error:{:08X}", self.code())?; match self.library() { - Some(l) => try!(write!(fmt, ":{}", l)), - None => try!(write!(fmt, ":lib({})", ffi::ERR_GET_LIB(self.code()))), + Some(l) => write!(fmt, ":{}", l)?, + None => write!(fmt, ":lib({})", ffi::ERR_GET_LIB(self.code()))?, } match self.function() { - Some(f) => try!(write!(fmt, ":{}", f)), - None => try!(write!(fmt, ":func({})", ffi::ERR_GET_FUNC(self.code()))), + Some(f) => write!(fmt, ":{}", f)?, + None => write!(fmt, ":func({})", ffi::ERR_GET_FUNC(self.code()))?, } match self.reason() { - Some(r) => try!(write!(fmt, ":{}", r)), - None => try!(write!(fmt, ":reason({})", ffi::ERR_GET_FUNC(self.code()))), + Some(r) => write!(fmt, ":{}", r)?, + None => write!(fmt, ":reason({})", ffi::ERR_GET_FUNC(self.code()))?, } write!( fmt, |