Skip to content

Commit

Permalink
rust: fix/silence clippy warnings and allow to run it in the first place
Browse files Browse the repository at this point in the history
  • Loading branch information
axxel committed Jan 20, 2024
1 parent f4f388c commit 9e03476
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion wrappers/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn main() -> miette::Result<()> {
println!("cargo:rustc-link-search=native={}", lib_dir);
println!("cargo:rustc-link-lib=dylib=ZXing");
} else {
panic!("ZXing library not found. Use feature 'bundled' or set environment variabale ZXING_CPP_LIB_DIR.")
// panic!("ZXing library not found. Use feature 'bundled' or set environment variabale ZXING_CPP_LIB_DIR.")
}

// manual bindings.rs generation:
Expand Down
12 changes: 10 additions & 2 deletions wrappers/rust/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#![allow(unused_unsafe)]
#![allow(clippy::useless_transmute)]
#![allow(clippy::redundant_closure_call)]

include!("bindings.rs");

Expand Down Expand Up @@ -102,7 +104,7 @@ impl Drop for ImageView<'_> {

impl<'a> AsRef<ImageView<'a>> for ImageView<'a> {
fn as_ref(&self) -> &ImageView<'a> {
&self
self
}
}

Expand Down Expand Up @@ -152,9 +154,15 @@ impl Drop for ReaderOptions {
}
}

impl Default for ReaderOptions {
fn default() -> Self {
Self::new()
}
}

impl AsRef<ReaderOptions> for ReaderOptions {
fn as_ref(&self) -> &ReaderOptions {
&self
self
}
}

Expand Down

0 comments on commit 9e03476

Please sign in to comment.