File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 6
6
//!
7
7
//! `#[no_std]` compatible.
8
8
// TODO: move to types crate.
9
- use std:: {
9
+
10
+ use core:: {
10
11
fmt:: { Display , Formatter } ,
11
12
str:: FromStr ,
12
13
} ;
@@ -52,17 +53,16 @@ impl FromStr for Network {
52
53
type Err = ParseNetworkError ;
53
54
54
55
fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
55
- match s. to_lowercase ( ) . as_str ( ) {
56
- "mainnet" => Ok ( Self :: Mainnet ) ,
57
- "testnet" => Ok ( Self :: Testnet ) ,
58
- "stagenet" => Ok ( Self :: Stagenet ) ,
56
+ match s {
57
+ "mainnet" | "Mainnet" => Ok ( Self :: Mainnet ) ,
58
+ "testnet" | "Testnet" => Ok ( Self :: Testnet ) ,
59
+ "stagenet" | "Stagenet" => Ok ( Self :: Stagenet ) ,
59
60
_ => Err ( ParseNetworkError ) ,
60
61
}
61
62
}
62
63
}
63
-
64
64
impl Display for Network {
65
- fn fmt ( & self , f : & mut Formatter < ' _ > ) -> std :: fmt:: Result {
65
+ fn fmt ( & self , f : & mut Formatter < ' _ > ) -> core :: fmt:: Result {
66
66
f. write_str ( match self {
67
67
Self :: Mainnet => "mainnet" ,
68
68
Self :: Testnet => "testnet" ,
You can’t perform that action at this time.
0 commit comments