Skip to content

Commit

Permalink
Reexport only Errno
Browse files Browse the repository at this point in the history
  • Loading branch information
Ten0 committed Oct 20, 2024
1 parent 0947e3c commit 25fa4be
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion examples/rados_striper.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#[cfg(feature = "rados_striper")]
use {
ceph::ceph as ceph_helpers, ceph::error::RadosError, nix::errno::Errno, std::env, std::str,
ceph::ceph as ceph_helpers,
ceph::error::{Errno, RadosError},
std::env,
std::str,
std::sync::Arc,
};

Expand Down
6 changes: 4 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ use uuid::Error as UuidError;

extern crate nix;

pub use nix::errno::Errno;

/// Custom error handling for the library
#[derive(Debug)]
pub enum RadosError {
FromUtf8Error(FromUtf8Error),
NulError(NulError),
Error(String),
IoError(Error),
ApiError(nix::errno::Errno),
ApiError(Errno),
IntoStringError(IntoStringError),
ParseIntError(ParseIntError),
ParseBoolError(ParseBoolError),
Expand Down Expand Up @@ -139,6 +141,6 @@ impl From<Error> for RadosError {
}
impl From<i32> for RadosError {
fn from(err: i32) -> RadosError {
RadosError::ApiError(nix::errno::Errno::from_raw(-err))
RadosError::ApiError(Errno::from_raw(-err))
}
}
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,3 @@ pub use crate::mon_command::MonCommand;

pub type JsonData = serde_json::Value;
pub type JsonValue = serde_json::Value;

pub use nix;

0 comments on commit 25fa4be

Please sign in to comment.