diff options
author | Nora <nora.widdecke@tu-bs.de> | 2019-06-19 23:17:31 +0200 |
---|---|---|
committer | Nora <nora.widdecke@tu-bs.de> | 2019-06-19 23:17:31 +0200 |
commit | 924cdbdff8c7abd374bbe8fc2e67e548f41ddf70 (patch) | |
tree | c271564ab6629efee684ef529c833f1f2eb7f19b | |
parent | 1d1b2d566a511dee3a1eda694b052f76b5f03c66 (diff) |
improve path handling in khline
-rw-r--r-- | src/khline.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/khline.rs b/src/khline.rs index e3397e8..7d70e9e 100644 --- a/src/khline.rs +++ b/src/khline.rs @@ -113,12 +113,11 @@ impl FromStr for KhLine { } fn to_filepath_checked(path_str: &str) -> Result<PathBuf, String> { - let path = PathBuf::from(path_str); - if defaults::get_caldir().join(path.clone()).is_file() { + if defaults::get_caldir().join(&path).is_file() { Ok(path) } else { - Err("path is not a file".to_string()) + Err(format!("path {} is not a file", path_str)) } } |