Use unused results
This commit is contained in:
parent
3f2114bf1f
commit
75fbcef4aa
1 changed files with 5 additions and 4 deletions
|
@ -32,7 +32,7 @@ pub fn create(rt: &Runtime) {
|
||||||
let path = scmd.value_of("path").or_else(|| scmd.value_of("id"));
|
let path = scmd.value_of("path").or_else(|| scmd.value_of("id"));
|
||||||
if path.is_none() {
|
if path.is_none() {
|
||||||
warn!("No ID / Path provided. Exiting now");
|
warn!("No ID / Path provided. Exiting now");
|
||||||
write!(stderr(), "No ID / Path provided. Exiting now");
|
write!(stderr(), "No ID / Path provided. Exiting now").ok();
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,14 +101,15 @@ fn create_from_source(rt: &Runtime, matches: &ArgMatches, path: &PathBuf) -> Res
|
||||||
debug!("Content with len = {}", content.len());
|
debug!("Content with len = {}", content.len());
|
||||||
|
|
||||||
Entry::from_str(path.clone(), &content[..])
|
Entry::from_str(path.clone(), &content[..])
|
||||||
.map(|mut new_e| {
|
.and_then(|new_e| {
|
||||||
rt.store()
|
let r = rt.store()
|
||||||
.create(path.clone())
|
.create(path.clone())
|
||||||
.map(|mut old_e| {
|
.map(|mut old_e| {
|
||||||
*old_e.deref_mut() = new_e;
|
*old_e.deref_mut() = new_e;
|
||||||
});
|
});
|
||||||
|
|
||||||
debug!("Entry build");
|
debug!("Entry build");
|
||||||
|
r
|
||||||
})
|
})
|
||||||
.map_err(|serr| StoreError::new(StoreErrorKind::BackendError, Some(Box::new(serr))))
|
.map_err(|serr| StoreError::new(StoreErrorKind::BackendError, Some(Box::new(serr))))
|
||||||
}
|
}
|
||||||
|
@ -144,7 +145,7 @@ fn string_from_raw_src(raw_src: &str) -> String {
|
||||||
debug!("Read {:?} bytes", res);
|
debug!("Read {:?} bytes", res);
|
||||||
} else {
|
} else {
|
||||||
debug!("Reading entry from file at {:?}", raw_src);
|
debug!("Reading entry from file at {:?}", raw_src);
|
||||||
OpenOptions::new()
|
let _ = OpenOptions::new()
|
||||||
.read(true)
|
.read(true)
|
||||||
.write(false)
|
.write(false)
|
||||||
.create(false)
|
.create(false)
|
||||||
|
|
Loading…
Reference in a new issue