From a8329530a61f123f2d574fa0ea9704ecad707a72 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 29 Jun 2023 23:15:29 +0200 Subject: [PATCH] don't convert path back to str --- plugins/persisted-scope/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/persisted-scope/src/lib.rs b/plugins/persisted-scope/src/lib.rs index e5da88c5..af489186 100644 --- a/plugins/persisted-scope/src/lib.rs +++ b/plugins/persisted-scope/src/lib.rs @@ -79,17 +79,17 @@ fn detect_scope_type(scope_state_path: &str) -> TargetType { } } -fn fix_directory(path_str: &str) -> &str { +fn fix_directory(path_str: &str) -> &Path { let mut path = Path::new(path_str); if path.ends_with(DIRECTORY_SUFFIX) || path.ends_with(RESURSIVE_DIRECTORY_SUFFIX) { path = match path.parent() { Some(value) => value, - None => return path_str, + None => return path, }; } - path.to_str().unwrap_or(path_str) + path } fn allow_path(scope: &FsScope, path: &str) {