image-rs / imageproc

Image processing operations
MIT License
755 stars 148 forks source link

Fix assert! macro string literal warning #463

Closed ireina7 closed 3 years ago

ireina7 commented 3 years ago

This PR fixed macro assert! usage warning:

warning: panic message is not a string literal
  --> src/filter/mod.rs:94:13
   |
94 | /             format!(
95 | |                 "Invalid kernel len: expecting {}, found {}",
96 | |                 width * height,
97 | |                 data.len()
98 | |             )
   | |_____________^
   |
   = note: `#[warn(non_fmt_panic)]` on by default
   = note: this is no longer accepted in Rust 2021
   = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: 1 warning emitted

The warning has been fixed in this PR by using string literal instead.

theotherphil commented 3 years ago

Thanks!