diff --git a/wrappers/rust/build.rs b/wrappers/rust/build.rs index ba457e5da3..6e6ba34f35 100644 --- a/wrappers/rust/build.rs +++ b/wrappers/rust/build.rs @@ -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: diff --git a/wrappers/rust/src/lib.rs b/wrappers/rust/src/lib.rs index e8092379ac..30c19f50b7 100644 --- a/wrappers/rust/src/lib.rs +++ b/wrappers/rust/src/lib.rs @@ -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"); @@ -102,7 +104,7 @@ impl Drop for ImageView<'_> { impl<'a> AsRef> for ImageView<'a> { fn as_ref(&self) -> &ImageView<'a> { - &self + self } } @@ -152,9 +154,15 @@ impl Drop for ReaderOptions { } } +impl Default for ReaderOptions { + fn default() -> Self { + Self::new() + } +} + impl AsRef for ReaderOptions { fn as_ref(&self) -> &ReaderOptions { - &self + self } }