Skip to content

Commit e067955

Browse files
committed
cleaner ensure_ptok implementation and version update
1 parent eab8063 commit e067955

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libipt"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
authors = ["sum_catnip <[email protected]>"]
55
edition = "2018"
66
license = "MIT"
@@ -12,4 +12,4 @@ repository = "https://github.com/sum-catnip/libipt-rs"
1212
[dependencies]
1313
libipt-sys = "^0.1.4"
1414
bitflags = "1.2.1"
15-
num_enum = "0.4.2"
15+
num_enum = "0.4.2"

src/error.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,7 @@ pub(crate) fn deref_ptresult_mut<T>(res: *mut T) -> Result<&'static mut T, PtErr
181181
// Discards the error code
182182
#[inline]
183183
pub(crate) fn ensure_ptok(code: i32) -> Result<(), PtError> {
184-
match code {
185-
x if x >= 0 => Ok(()),
186-
_ => Err(PtError::from_code(code))
187-
}
184+
extract_pterr(code).map(|_|())
188185
}
189186

190187
// Turns a negative code into a PtErr.

0 commit comments

Comments
 (0)