~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.
5926e657
—
pyrossh 1 month ago
Fix embedded data being duplicated in binary ([email protected])
- impl/src/lib.rs +1 -1
impl/src/lib.rs
CHANGED
|
@@ -80,7 +80,7 @@ fn embedded(
|
|
|
80
80
|
pub fn get(file_path: &str) -> ::std::option::Option<#crate_path::EmbeddedFile> {
|
|
81
81
|
#handle_prefix
|
|
82
82
|
let key = file_path.replace("\\", "/");
|
|
83
|
-
|
|
83
|
+
static ENTRIES: &'static [(&'static str, #value_type)] = &[
|
|
84
84
|
#(#match_values)*];
|
|
85
85
|
let position = ENTRIES.binary_search_by_key(&key.as_str(), |entry| entry.0);
|
|
86
86
|
position.ok().map(#get_value)
|