From 36cd42c0e87333cdfc611e5e7ca0702bab2e3709 Mon Sep 17 00:00:00 2001 From: Samuel Moelius <35515885+smoelius@users.noreply.github.com> Date: Wed, 13 Mar 2024 07:42:05 -0400 Subject: [PATCH] Eliminate unnecessary `to_path` call --- impl/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impl/src/lib.rs b/impl/src/lib.rs index cedb14b..b2e8c03 100644 --- a/impl/src/lib.rs +++ b/impl/src/lib.rs @@ -147,7 +147,7 @@ fn dynamic(ident: &syn::Ident, folder_path: String, prefix: Option<&str>, includ // and check that instead if it starts with `canonical_folder_path` // https://doc.rust-lang.org/std/path/fn.absolute.html (currently nightly) // Should be allowed only if it was a symlink - let metadata = ::std::fs::symlink_metadata(file_path.as_path()).ok()?; + let metadata = ::std::fs::symlink_metadata(&file_path).ok()?; if !metadata.is_symlink() { return ::std::option::Option::None; }