This commit is contained in:
Richard Feldman 2022-11-22 10:58:42 -05:00
parent 52b71cd85f
commit 7356809fc3
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
2 changed files with 3 additions and 2 deletions

View file

@ -43,6 +43,7 @@ fn load<'a>(
} }
/// Load using only a single thread; used when compiling to webassembly /// Load using only a single thread; used when compiling to webassembly
#[allow(clippy::too_many_arguments)]
pub fn load_single_threaded<'a>( pub fn load_single_threaded<'a>(
arena: &'a Bump, arena: &'a Bump,
load_start: LoadStart<'a>, load_start: LoadStart<'a>,

View file

@ -176,10 +176,10 @@ impl Encoding {
"" => { "" => {
// There was no Content-Encoding header, but we can infer the encoding // There was no Content-Encoding header, but we can infer the encoding
// from the file extension in the URL. // from the file extension in the URL.
let end_of_ext = url.rfind('#').unwrap_or_else(|| url.len()); let end_of_ext = url.rfind('#').unwrap_or(url.len());
// Drop the URL fragment when determining file extension // Drop the URL fragment when determining file extension
match url[0..end_of_ext].rsplit_once(".") { match url[0..end_of_ext].rsplit_once('.') {
Some((_, after_dot)) => match Compression::from_file_ext(after_dot) { Some((_, after_dot)) => match Compression::from_file_ext(after_dot) {
Some(Compression::Brotli) => Ok(Self::Brotli), Some(Compression::Brotli) => Ok(Self::Brotli),
Some(Compression::Gzip) => Ok(Self::Gzip), Some(Compression::Gzip) => Ok(Self::Gzip),