~repos /rust-embed
git clone https://pyrossh.dev/repos/rust-embed.git
rust macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.
f7c7268a
—
Peter John 1 year ago
Merge pull request #239 from smoelius/patch-1
- 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
|
}
|