Skip to content

Commit 22432cf

Browse files
committed
Make ErrorType a RustEnum, and flag it as must_use
1 parent 557d7b7 commit 22432cf

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
mod SvtAV1Sys;
2+
3+
4+
15
#[cfg(test)]
26
mod tests {
37
#[test]

svt-av1-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "svt-av1-sys"
3-
version = "0.1.1"
3+
version = "0.2.0"
44
authors = ["Luca Barbato <lu_zero@gentoo.org>"]
55
license = "MIT"
66
description = "FFI bindings to SVT-AV1"

svt-av1-sys/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
#[cfg_attr(feature = "cargo-clippy", allow(const_static_lifetime))]
77
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
88

9-
pub mod SvtAV1 {
9+
pub mod SvtAV1Sys {
1010
include!(concat!(env!("OUT_DIR"), "/svtav1.rs"));
1111
}
1212

13-
pub use SvtAV1::*;
13+
pub use SvtAV1Sys::*;
1414

1515
#[cfg(test)]
1616
mod tests {
@@ -24,18 +24,18 @@ mod tests {
2424
let mut cfg = mem::MaybeUninit::zeroed();
2525

2626
let ret = svt_av1_enc_init_handle(&mut handle, ptr::null_mut(), cfg.as_mut_ptr());
27-
assert_eq!(ret, 0);
27+
assert_eq!(ret, EbErrorType::EB_ErrorNone);
2828

2929
let mut cfg = cfg.assume_init();
3030

3131
cfg.source_width = 64;
3232
cfg.source_height = 64;
3333

3434
let ret = svt_av1_enc_set_parameter(handle, &mut cfg);
35-
assert_eq!(ret, 0);
35+
assert_eq!(ret, EbErrorType::EB_ErrorNone);
3636

3737
let ret = svt_av1_enc_init(handle);
38-
assert_eq!(ret, 0);
38+
assert_eq!(ret, EbErrorType::EB_ErrorNone);
3939
}
4040
}
4141
}

0 commit comments

Comments
 (0)