Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 0 additions & 67 deletions primitive-types/src/error.rs

This file was deleted.

13 changes: 10 additions & 3 deletions primitive-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@

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

mod error;

pub use error::{Error, TryFrom, TryInto, Never};
#![cfg(feature = "std")]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this really correct?
why enforce feature = std in the crate?

I guess it should be #[cfg(feature = "std")]?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested in edition 2015 #[cfg(feature = "std")] is still necessary, otherwise compiler would complain core being reimported when building no_std.

extern crate core;

#[macro_use]
extern crate uint;
Expand All @@ -36,6 +35,14 @@ extern crate impl_codec;
#[macro_use]
extern crate impl_rlp;

use core::convert::TryFrom;

/// Error type for conversion.
pub enum Error {
/// Overflow encountered.
Overflow,
}

construct_uint! {
/// 128-bit unsigned integer.
pub struct U128(2);
Expand Down