Remove core feature
This commit is contained in:
parent
5fe9d2b094
commit
0313e97134
|
@ -19,10 +19,8 @@ before_install:
|
||||||
script:
|
script:
|
||||||
- cargo build --verbose
|
- cargo build --verbose
|
||||||
- cargo test --verbose
|
- cargo test --verbose
|
||||||
- cargo build --verbose --no-default-features
|
- cargo build --verbose --no-default-features --features all-languages
|
||||||
- cargo test --verbose --no-default-features
|
- cargo test --verbose --no-default-features --features all-languages
|
||||||
- cargo build --verbose --no-default-features --features core,all-languages
|
|
||||||
- cargo test --verbose --no-default-features --features core,all-languages
|
|
||||||
- cargo build --verbose --features rand,all-languages
|
- cargo build --verbose --features rand,all-languages
|
||||||
- cargo test --verbose --features rand,all-languages
|
- cargo test --verbose --features rand,all-languages
|
||||||
# benchmarks
|
# benchmarks
|
||||||
|
|
|
@ -16,8 +16,7 @@ path = "src/lib.rs"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [ "std" ]
|
default = [ "std" ]
|
||||||
core = []
|
std = [ "unicode-normalization", "serde/std" ]
|
||||||
std = [ "core", "unicode-normalization", "serde/std" ]
|
|
||||||
|
|
||||||
# Note: English is the standard for bip39 so always included
|
# Note: English is the standard for bip39 so always included
|
||||||
chinese-simplified = []
|
chinese-simplified = []
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
|
|
||||||
#[cfg(feature = "core")]
|
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
|
|
||||||
mod english;
|
mod english;
|
||||||
|
@ -153,7 +152,6 @@ impl Language {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "core")]
|
|
||||||
impl fmt::Display for Language {
|
impl fmt::Display for Language {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
fmt::Debug::fmt(self, f)
|
fmt::Debug::fmt(self, f)
|
||||||
|
|
|
@ -42,7 +42,6 @@ extern crate rand;
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
pub extern crate serde;
|
pub extern crate serde;
|
||||||
|
|
||||||
#[cfg(feature = "core")]
|
|
||||||
use core::{fmt, str};
|
use core::{fmt, str};
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
|
@ -82,7 +81,6 @@ impl AmbiguousLanguages {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An iterator over the possible languages.
|
/// An iterator over the possible languages.
|
||||||
#[cfg(feature = "core")]
|
|
||||||
pub fn iter(&self) -> impl Iterator<Item = Language> + '_ {
|
pub fn iter(&self) -> impl Iterator<Item = Language> + '_ {
|
||||||
Language::all().iter().enumerate().filter(move |(i, _)| self.0[*i]).map(|(_, l)| *l)
|
Language::all().iter().enumerate().filter(move |(i, _)| self.0[*i]).map(|(_, l)| *l)
|
||||||
}
|
}
|
||||||
|
@ -113,7 +111,6 @@ pub enum Error {
|
||||||
AmbiguousLanguages(AmbiguousLanguages),
|
AmbiguousLanguages(AmbiguousLanguages),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "core")]
|
|
||||||
impl fmt::Display for Error {
|
impl fmt::Display for Error {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match *self {
|
match *self {
|
||||||
|
@ -469,7 +466,6 @@ impl Mnemonic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "core")]
|
|
||||||
impl fmt::Display for Mnemonic {
|
impl fmt::Display for Mnemonic {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
for i in 0..self.0.len() {
|
for i in 0..self.0.len() {
|
||||||
|
@ -486,7 +482,6 @@ impl fmt::Display for Mnemonic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "core")]
|
|
||||||
impl str::FromStr for Mnemonic {
|
impl str::FromStr for Mnemonic {
|
||||||
type Err = Error;
|
type Err = Error;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue