Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Nov 3, 2024
1 parent 6508c1d commit b6d15d0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# reset to default
9 changes: 4 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ fn main() {
};

for filename in env::args().skip(1) {
let file = File::open(&filename)
.unwrap_or_else(|why| panic!("couldn't open {filename}: {why}"));
let file =
File::open(&filename).unwrap_or_else(|why| panic!("couldn't open {filename}: {why}"));
let filesize = file.metadata().map(|x| x.len()).unwrap() as usize;

let out_filename = format!("{filename}{extension}");
Expand All @@ -32,9 +32,8 @@ fn main() {
.unwrap_or_else(|why| panic!("couldn't create output file {out_filename}: {why}"));
let mut out_file = WriteStatistics::new(out_file);

zopfli::compress(options, output_type, &file, &mut out_file).unwrap_or_else(|why| {
panic!("couldn't write to output file {out_filename}: {why}")
});
zopfli::compress(options, output_type, &file, &mut out_file)
.unwrap_or_else(|why| panic!("couldn't write to output file {out_filename}: {why}"));

let out_size = out_file.count;
info!(
Expand Down
3 changes: 2 additions & 1 deletion src/squeeze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ fn add_weighed_stat_freqs(
(stats1.litlens[i] as f64).mul_add(w1, stats2.litlens[i] as f64 * w2) as usize;

Check failure

Code scanning / clippy

no method named mul_add found for type f64 in the current scope Error

no method named mul\_add found for type f64 in the current scope
}
for i in 0..ZOPFLI_NUM_D {
result.dists[i] = (stats1.dists[i] as f64).mul_add(w1, stats2.dists[i] as f64 * w2) as usize;
result.dists[i] =
(stats1.dists[i] as f64).mul_add(w1, stats2.dists[i] as f64 * w2) as usize;

Check failure

Code scanning / clippy

no method named mul_add found for type f64 in the current scope Error

no method named mul\_add found for type f64 in the current scope
}
result.litlens[256] = 1; // End symbol.
result
Expand Down

0 comments on commit b6d15d0

Please sign in to comment.