Skip to content

Commit 966092b

Browse files
committed
Remove errno dependency
1 parent 89beb9f commit 966092b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pymath"
3-
version = "0.0.1"
3+
version = "0.0.2"
44
edition = "2024"
55
description = "A binary representation compatible Rust implementation of Python's math library."
66
license = "PSF-2.0"
@@ -16,7 +16,6 @@ license = "PSF-2.0"
1616
mul_add = []
1717

1818
[dependencies]
19-
errno = "0.3"
2019
libc = "0.2"
2120

2221
[dev-dependencies]

src/err.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::ffi::c_int;
2+
13
// The values are defined in libc
24
#[derive(Debug, PartialEq, Eq)]
35
pub enum Error {
@@ -7,10 +9,10 @@ pub enum Error {
79

810
pub type Result<T> = std::result::Result<T, Error>;
911

10-
impl TryFrom<libc::c_int> for Error {
11-
type Error = libc::c_int;
12+
impl TryFrom<c_int> for Error {
13+
type Error = c_int;
1214

13-
fn try_from(value: libc::c_int) -> std::result::Result<Self, Self::Error> {
15+
fn try_from(value: c_int) -> std::result::Result<Self, Self::Error> {
1416
match value {
1517
33 => Ok(Error::EDOM),
1618
34 => Ok(Error::ERANGE),

0 commit comments

Comments
 (0)