Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion crates/oxc_transformer/src/jsx/refresh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,13 @@ impl<'a> ReactRefresh<'a, '_> {
// We also need it for www that has transforms like cx()
// that don't understand if something is part of a string.
const SHA1_HASH_LEN: usize = 20;
const ENCODED_LEN: usize = base64_encoded_len(SHA1_HASH_LEN, true).unwrap();
const ENCODED_LEN: usize = {
let len = base64_encoded_len(SHA1_HASH_LEN, true);
match len {
Some(l) => l,
None => panic!("Invalid base64 length"),
}
};

let mut hasher = Sha1::new();
hasher.update(&key);
Expand Down