Skip to content

Commit 623ba49

Browse files
committed
fix cargo hack
1 parent 3664eb1 commit 623ba49

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

helper/src/network.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
//!
77
//! `#[no_std]` compatible.
88
// TODO: move to types crate.
9-
use std::{
9+
10+
use core::{
1011
fmt::{Display, Formatter},
1112
str::FromStr,
1213
};
@@ -52,17 +53,16 @@ impl FromStr for Network {
5253
type Err = ParseNetworkError;
5354

5455
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),
5960
_ => Err(ParseNetworkError),
6061
}
6162
}
6263
}
63-
6464
impl Display for Network {
65-
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
65+
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
6666
f.write_str(match self {
6767
Self::Mainnet => "mainnet",
6868
Self::Testnet => "testnet",

0 commit comments

Comments
 (0)