aboutsummaryrefslogtreecommitdiff
path: root/src/command/update.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/command/update.rs')
-rw-r--r--src/command/update.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/command/update.rs b/src/command/update.rs
index 67cc462..8a3d6de 100644
--- a/src/command/update.rs
+++ b/src/command/update.rs
@@ -55,7 +55,8 @@ impl super::Command for Update {
}
fn execute(&self, input: Option<&String>, configuration: &Configuration, _: &String) -> Result<()> {
- let input = input.expect("You must provide a path to a post");
+ let input = input
+ .ok_or_else(|| Error::new(ErrorKind::InvalidInput, "You must provide a path to a post"))?;
let post_location = PathBuf::from(input);
if !post_location.exists() {
return Err(Error::new(ErrorKind::NotFound, "The path provided does not exist"));