summaryrefslogtreecommitdiffstats
path: root/lib/core/libimagstore/src/file_abstraction/stdio
diff options
context:
space:
mode:
Diffstat (limited to 'lib/core/libimagstore/src/file_abstraction/stdio')
-rw-r--r--lib/core/libimagstore/src/file_abstraction/stdio/mapper/json.rs10
-rw-r--r--lib/core/libimagstore/src/file_abstraction/stdio/mod.rs9
-rw-r--r--lib/core/libimagstore/src/file_abstraction/stdio/out.rs2
3 files changed, 10 insertions, 11 deletions
diff --git a/lib/core/libimagstore/src/file_abstraction/stdio/mapper/json.rs b/lib/core/libimagstore/src/file_abstraction/stdio/mapper/json.rs
index 3bd46d6c..7bc8fc9d 100644
--- a/lib/core/libimagstore/src/file_abstraction/stdio/mapper/json.rs
+++ b/lib/core/libimagstore/src/file_abstraction/stdio/mapper/json.rs
@@ -73,15 +73,15 @@ impl Mapper for JsonMapper {
let mut document = {
debug!("Reading Document");
let mut s = String::new();
- try!(r.read_to_string(&mut s).chain_err(|| SEK::IoError));
+ r.read_to_string(&mut s).chain_err(|| SEK::IoError)?;
debug!("Document = {:?}", s);
debug!("Parsing Document");
- let doc : Document = try!(serde_json::from_str(&s).chain_err(|| SEK::IoError));
+ let doc : Document = serde_json::from_str(&s).chain_err(|| SEK::IoError)?;
debug!("Document = {:?}", doc);
doc
};
- let _ = try!(::semver::Version::parse(&document.version)
+ let _ = ::semver::Version::parse(&document.version)
.chain_err(|| SEK::VersionError)
.and_then(|doc_vers| {
// safe because cargo does not compile if crate version is not valid
@@ -96,7 +96,7 @@ impl Mapper for JsonMapper {
} else {
Ok(())
}
- }));
+ })?;
for (key, val) in document.store.drain() {
debug!("(key, value) ({:?}, {:?})", key, val);
@@ -110,7 +110,7 @@ impl Mapper for JsonMapper {
})
.map(|_| ());
- let _ = try!(res);
+ let _ = res?;
}
Ok(())
diff --git a/lib/core/libimagstore/src/file_abstraction/stdio/mod.rs b/lib/core/libimagstore/src/file_abstraction/stdio/mod.rs
index 7bf4f425..5b93f6f0 100644
--- a/lib/core/libimagstore/src/file_abstraction/stdio/mod.rs
+++ b/lib/core/libimagstore/src/file_abstraction/stdio/mod.rs
@@ -56,11 +56,10 @@ impl<W, M> StdIoFileAbstraction<W, M>
pub fn new<R: Read>(in_stream: &mut R, out_stream: Rc<RefCell<W>>, mapper: M) -> Result<StdIoFileAbstraction<W, M>, SE> {
StdoutFileAbstraction::new(out_stream, mapper)
.and_then(|out| {
- let _ = try!(out
- .backend()
- .lock()
- .map_err(|_| SE::from_kind(SEK::LockError))
- .map(|mut mtx| out.mapper().read_to_fs(in_stream, mtx.get_mut())));
+ let _ = out.backend()
+ .lock()
+ .map_err(|_| SE::from_kind(SEK::LockError))
+ .map(|mut mtx| out.mapper().read_to_fs(in_stream, mtx.get_mut()))?;
Ok(StdIoFileAbstraction(out))
})
diff --git a/lib/core/libimagstore/src/file_abstraction/stdio/out.rs b/lib/core/libimagstore/src/file_abstraction/stdio/out.rs
index c8540b33..5f62e899 100644
--- a/lib/core/libimagstore/src/file_abstraction/stdio/out.rs
+++ b/lib/core/libimagstore/src/file_abstraction/stdio/out.rs
@@ -150,7 +150,7 @@ impl<W: Write, M: Mapper> FileAbstraction for StdoutFileAbstraction<W, M> {
fn fill(&mut self, mut d: Drain) -> Result<(), SE> {
debug!("Draining into : {:?}", self);
- let mut mtx = try!(self.backend().lock().map_err(|_| SE::from_kind(SEK::IoError)));
+ let mut mtx = self.backend().lock().map_err(|_| SE::from_kind(SEK::IoError))?;
let backend = mtx.get_mut();
for (path, element) in d.iter() {