Skip to content

Commit

Permalink
Update err-derive.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rouven Spreckels committed Oct 27, 2019
1 parent 11b0ed9 commit 32a2cde
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "signifix"
version = "0.10.0"
edition = "2018"
authors = [
"Rouven Spreckels <n3vu0r@qu1x.org>",
]
Expand Down Expand Up @@ -34,4 +35,4 @@ include = [
travis-ci = { repository = "qu1x/signifix" }

[dependencies]
err-derive = "0.1"
err-derive = "0.2"
2 changes: 2 additions & 0 deletions src/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//
// DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.

use err_derive::Error;

use std::convert::TryFrom;

use std::result;
Expand Down
19 changes: 3 additions & 16 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,7 @@

#![deny(missing_docs)]

#[macro_use]
extern crate err_derive;
use err_derive::Error;

use std::result;

Expand Down Expand Up @@ -451,23 +450,11 @@ pub mod binary;
pub enum Error {
/// A given number is not representable with any metric prefix.
#[error(display = "Not representable with any metric prefix")]
Metric(#[cause] metric::Error),
Metric(#[source] metric::Error),

/// A given number is not representable with any binary prefix.
#[error(display = "Not representable with any binary prefix")]
Binary(#[cause] binary::Error),
}

impl From<metric::Error> for Error {
fn from(error: metric::Error) -> Self {
Error::Metric(error)
}
}

impl From<binary::Error> for Error {
fn from(error: binary::Error) -> Self {
Error::Binary(error)
}
Binary(#[source] binary::Error),
}

/// The canonical `Result` type using this crate's `Error` type.
Expand Down
2 changes: 2 additions & 0 deletions src/metric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//
// DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.

use err_derive::Error;

use std::convert::TryFrom;

use std::result;
Expand Down

0 comments on commit 32a2cde

Please sign in to comment.