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