Reduce number of unwwaps in api crate (#2681)

* Reduce number of unwwaps in api crate

* Format use section
This commit is contained in:
hashmap
2019-03-18 19:34:35 +01:00
committed by GitHub
parent 2b218f2dc3
commit 7fad5b040f
17 changed files with 165 additions and 123 deletions
+2 -2
View File
@@ -45,12 +45,12 @@ pub struct StatusHandler {
impl StatusHandler {
fn get_status(&self) -> Result<Status, Error> {
let head = w(&self.chain)
let head = w(&self.chain)?
.head()
.map_err(|e| ErrorKind::Internal(format!("can't get head: {}", e)))?;
Ok(Status::from_tip_and_peers(
head,
w(&self.peers).peer_count(),
w(&self.peers)?.peer_count(),
))
}
}