X-Git-Url: https://git.r.bdr.sh/rbdr/blog/blobdiff_plain/f6a545b00a4046879b7cc25c06c37bb6b6880b43..5080a41dec9423dceb43a5c7ded8b9e1ddc0817e:/src/command/update.rs 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"));