rust-embed v8.11.0
git clone https://git.pyrossh.dev/rust-embed
rust macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.
36cd42c
— Samuel Moelius
2024-03-13T07:42:05-04:00
Eliminate unnecessary `to_path` call
- impl/src/lib.rs +1 -1
impl/src/lib.rs
CHANGED
|
@@ -147,7 +147,7 @@ fn dynamic(ident: &syn::Ident, folder_path: String, prefix: Option<&str>, includ
|
|
|
147
147
|
// and check that instead if it starts with `canonical_folder_path`
|
|
148
148
|
// https://doc.rust-lang.org/std/path/fn.absolute.html (currently nightly)
|
|
149
149
|
// Should be allowed only if it was a symlink
|
|
150
|
-
let metadata = ::std::fs::symlink_metadata(file_path
|
|
150
|
+
let metadata = ::std::fs::symlink_metadata(&file_path).ok()?;
|
|
151
151
|
if !metadata.is_symlink() {
|
|
152
152
|
return ::std::option::Option::None;
|
|
153
153
|
}
|