}
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"));