Skip to content

Commit

Permalink
primitive-types: address nits of #480
Browse files Browse the repository at this point in the history
  • Loading branch information
ordian committed Dec 25, 2020
1 parent da4262d commit 2641855
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions primitive-types/impls/num-traits/Cargo.toml
Expand Up @@ -10,7 +10,3 @@ edition = "2018"
[dependencies]
num-traits = { version = "0.2", default-features = false }
uint = { version = "0.8.5", path = "../../../uint", default-features = false }

[features]
default = ["std"]
std = ["num-traits/std", "uint/std"]
7 changes: 4 additions & 3 deletions primitive-types/impls/num-traits/src/lib.rs
Expand Up @@ -8,12 +8,13 @@

//! num-traits support for uint.

#![cfg_attr(not(feature = "std"), no_std)]
#![no_std]

#[doc(hidden)]
pub use num_traits;

pub use uint::{FromStrRadixErr, FromStrRadixErrKind};
#[doc(hidden)]
pub use uint;

/// Add num-traits support to an integer created by `construct_uint!`.
#[macro_export]
Expand All @@ -39,7 +40,7 @@ macro_rules! impl_uint_num_traits {
}

impl $crate::num_traits::Num for $name {
type FromStrRadixErr = $crate::FromStrRadixErr;
type FromStrRadixErr = $crate::uint::FromStrRadixErr;

fn from_str_radix(txt: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr> {
Self::from_str_radix(txt, radix)
Expand Down
1 change: 0 additions & 1 deletion primitive-types/src/lib.rs
Expand Up @@ -22,7 +22,6 @@ use fixed_hash::{construct_fixed_hash, impl_fixed_hash_conversions};
#[cfg(feature = "scale-info")]
use scale_info::TypeInfo;
use uint::{construct_uint, uint_full_mul_reg};
pub use uint::{FromStrRadixErr, FromStrRadixErrKind};

/// Error type for conversion.
#[derive(Debug, PartialEq, Eq)]
Expand Down

0 comments on commit 2641855

Please sign in to comment.