~repos /rust-embed

#rust#proc-macro#http

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.


36cd42c0 Samuel Moelius

1 year ago
Eliminate unnecessary `to_path` call
Files changed (1) hide show
  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.as_path()).ok()?;
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
  }