Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions benches/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ where
let mut output: Vec<u8> = Vec::with_capacity(image.size.pixels() as usize * 16);

b.iter(|| {
output.truncate(0);
output.clear();

let image = black_box(image);

Expand Down Expand Up @@ -334,7 +334,7 @@ pub fn generate_mipmaps(c: &mut Criterion) {
let mut output: Vec<u8> = Vec::with_capacity(len);

b.iter(|| {
output.truncate(0);
output.clear();

let image = black_box(image);

Expand Down
4 changes: 1 addition & 3 deletions src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1246,10 +1246,8 @@ impl Dx9Header {
DxgiFormat::BC2_UNORM
} else if *four_cc == FourCC::DXT4 {
DxgiFormat::BC3_UNORM
} else if let Some(dxgi) = four_cc_to_dxgi(*four_cc) {
dxgi
} else {
return None;
four_cc_to_dxgi(*four_cc)?
}
}
Dx9PixelFormat::Mask(mask_pixel_format) => masked_to_dxgi(mask_pixel_format)?,
Expand Down
2 changes: 1 addition & 1 deletion tests/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn parse_data_layout_of_all_dds_files() {

let data_len = file_len - get_header_byte_len(&header);
let expected_len = info.layout.data_len();
assert_eq!(data_len, expected_len, "File: {:?}", &dds_path);
assert_eq!(data_len, expected_len, "File: {:?}", dds_path);
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/pixel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ fn from_header() {
let from_format = PixelInfo::from(format);
let from_header = PixelInfo::from_header(&header).ok();

assert_eq!(Some(from_format), from_header, "File: {:?}", &dds_path);
assert_eq!(Some(from_format), from_header, "File: {:?}", dds_path);
}
}
Loading