~repos /rust-embed
GIT_CONFIG_PARAMETERS="'http.version=HTTP/1.1'" git clone
https://git.pyrossh.dev/rust-embed/.git
rust-embed
Discussions:
https://groups.google.com/g/rust-embed-devs
rust macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.
207381db
—
Tommy Yu 1 month ago
Remove redundant `Option`/`.unwrap()` and comment
- impl/src/lib.rs +2 -3
impl/src/lib.rs
CHANGED
|
@@ -368,7 +368,7 @@ fn impl_rust_embed(ast: &syn::DeriveInput) -> syn::Result<TokenStream2> {
|
|
|
368
368
|
"#[derive(RustEmbed)] must contain one attribute like this #[folder = \"examples/public/\"]",
|
|
369
369
|
));
|
|
370
370
|
}
|
|
371
|
-
let folder_path =
|
|
371
|
+
let folder_path = folder_paths.remove(0);
|
|
372
372
|
|
|
373
373
|
let prefix = find_attribute_values(ast, "prefix").into_iter().next();
|
|
374
374
|
let includes = find_attribute_values(ast, "include");
|
|
@@ -384,9 +384,8 @@ fn impl_rust_embed(ast: &syn::DeriveInput) -> syn::Result<TokenStream2> {
|
|
|
384
384
|
));
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
-
// .map_err(|v| syn::Error::new_spanned(ast, v.to_string()))?
|
|
388
387
|
#[cfg(feature = "interpolate-folder-path")]
|
|
389
|
-
let folder_path = match shellexpand::full(&folder_path
|
|
388
|
+
let folder_path = match shellexpand::full(&folder_path) {
|
|
390
389
|
Ok(v) => Ok(Some(v.to_string())),
|
|
391
390
|
Err(v) if v.cause == std::env::VarError::NotPresent && allow_missing => Ok(None),
|
|
392
391
|
Err(v) => Err(syn::Error::new_spanned(ast, v.to_string())),
|