From cd201e8f5c1af33972435e2d9a66cd5cdcbc6c77 Mon Sep 17 00:00:00 2001 From: Evan Carroll Date: Sat, 3 Jun 2023 13:25:21 -0500 Subject: [PATCH] Make ErrorType a RustEnum, and flag it as must_use --- svt-av1-sys/Cargo.toml | 2 +- svt-av1-sys/src/lib.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/svt-av1-sys/Cargo.toml b/svt-av1-sys/Cargo.toml index e2e05f9..b024a16 100644 --- a/svt-av1-sys/Cargo.toml +++ b/svt-av1-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "svt-av1-sys" -version = "0.1.1" +version = "0.2.0" authors = ["Luca Barbato "] license = "MIT" description = "FFI bindings to SVT-AV1" diff --git a/svt-av1-sys/src/lib.rs b/svt-av1-sys/src/lib.rs index 11281ef..d26b961 100644 --- a/svt-av1-sys/src/lib.rs +++ b/svt-av1-sys/src/lib.rs @@ -6,11 +6,11 @@ #[cfg_attr(feature = "cargo-clippy", allow(const_static_lifetime))] #[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] -pub mod SvtAV1 { +pub mod SvtAV1Sys { include!(concat!(env!("OUT_DIR"), "/svtav1.rs")); } -pub use SvtAV1::*; +pub use SvtAV1Sys::*; #[cfg(test)] mod tests { @@ -24,7 +24,7 @@ mod tests { let mut cfg = mem::MaybeUninit::zeroed(); let ret = svt_av1_enc_init_handle(&mut handle, ptr::null_mut(), cfg.as_mut_ptr()); - assert_eq!(ret, 0); + assert_eq!(ret, EbErrorType::EB_ErrorNone); let mut cfg = cfg.assume_init(); @@ -32,10 +32,10 @@ mod tests { cfg.source_height = 64; let ret = svt_av1_enc_set_parameter(handle, &mut cfg); - assert_eq!(ret, 0); + assert_eq!(ret, EbErrorType::EB_ErrorNone); let ret = svt_av1_enc_init(handle); - assert_eq!(ret, 0); + assert_eq!(ret, EbErrorType::EB_ErrorNone); } } }