ritchie46 / lsh-rs

Locality Sensitive Hashing in Rust with Python bindings
MIT License
109 stars 20 forks source link

Use a string literal for the panic message #15

Closed orhun closed 1 year ago

orhun commented 1 year ago

Fixes the following compilation error:

warning: panic message is not a string literal
  --> /home/orhun/gh/lsh-rs/lsh-rs/src/lsh/lsh.rs:82:30
   |
82 |             Err(e) => panic!(format!("could not load hashers: {}", e)),
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
   = note: the `panic!()` macro supports formatting, so there's no need for the `format!()` macro here
   = note: `#[warn(non_fmt_panics)]` on by default
help: remove the `format!(..)` macro call
   |
82 -             Err(e) => panic!(format!("could not load hashers: {}", e)),
82 +             Err(e) => panic!("could not load hashers: {}", e),
   |

warning: `lsh-rs` (lib) generated 1 warning (run `cargo fix --lib -p lsh-rs` to apply 1 suggestion)
ritchie46 commented 1 year ago

Thanks!

orhun commented 1 year ago

Hey @ritchie46, we are currently using the git version of this crate in our project. Would you be down to create a release soon? That would be really nice!