Skip to content

Commit

Permalink
Use function
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja committed Aug 18, 2024
1 parent 164ad8b commit 7253a65
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,7 @@ pub fn static_loader(input: proc_macro::TokenStream) -> proc_macro::TokenStream
};

let language_quote = {
let language_as_bytes = fallback_language_identifier.language.as_str().as_bytes();
let mut language_buf = [0u8; 8];
language_buf[..language_as_bytes.len()].copy_from_slice(language_as_bytes);
let language_as_u64 = u64::from_le_bytes(language_buf);
let language_as_u64 = str_to_u64(fallback_language_identifier.language.as_str());
quote! {
unsafe { unic_langid::subtags::Language::from_raw_unchecked(#language_as_u64) }
}
Expand Down

0 comments on commit 7253a65

Please # to comment.