Skip to content

Commit

Permalink
Provide error message for files unsupported by asset_util (#2390)
Browse files Browse the repository at this point in the history
* Provide error message for files unsupported by asset_util

* +=clippy
  • Loading branch information
przydatek authored Mar 27, 2024
1 parent 6bcf6d6 commit ac5df33
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/asset_util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,11 @@ fn collect_assets_rec(dir: &Dir, assets: &mut Vec<Asset>) {
/// Otherwise the content type is determined by the text after the last dot in the file name,
/// and the encoding is `ContentEncoding::Identity`.
fn content_type_and_encoding(asset_path: &Path) -> (ContentType, ContentEncoding) {
let extension = asset_path.extension().unwrap().to_str().unwrap();
let extension = asset_path
.extension()
.unwrap_or_else(|| panic!("Unsupported file without extension: {:?}", asset_path))
.to_str()
.unwrap();
let (extension, encoding) = if extension == "gz" {
let type_extension = asset_path
.file_name()
Expand Down

0 comments on commit ac5df33

Please sign in to comment.