mirror of
https://github.com/hinto-janai/cuprate.git
synced 2025-01-22 02:34:29 +00:00
fix cargo hack
This commit is contained in:
parent
3664eb1b08
commit
623ba49bb1
1 changed files with 7 additions and 7 deletions
|
@ -6,7 +6,8 @@
|
||||||
//!
|
//!
|
||||||
//! `#[no_std]` compatible.
|
//! `#[no_std]` compatible.
|
||||||
// TODO: move to types crate.
|
// TODO: move to types crate.
|
||||||
use std::{
|
|
||||||
|
use core::{
|
||||||
fmt::{Display, Formatter},
|
fmt::{Display, Formatter},
|
||||||
str::FromStr,
|
str::FromStr,
|
||||||
};
|
};
|
||||||
|
@ -52,17 +53,16 @@ impl FromStr for Network {
|
||||||
type Err = ParseNetworkError;
|
type Err = ParseNetworkError;
|
||||||
|
|
||||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||||
match s.to_lowercase().as_str() {
|
match s {
|
||||||
"mainnet" => Ok(Self::Mainnet),
|
"mainnet" | "Mainnet" => Ok(Self::Mainnet),
|
||||||
"testnet" => Ok(Self::Testnet),
|
"testnet" | "Testnet" => Ok(Self::Testnet),
|
||||||
"stagenet" => Ok(Self::Stagenet),
|
"stagenet" | "Stagenet" => Ok(Self::Stagenet),
|
||||||
_ => Err(ParseNetworkError),
|
_ => Err(ParseNetworkError),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Display for Network {
|
impl Display for Network {
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
|
||||||
f.write_str(match self {
|
f.write_str(match self {
|
||||||
Self::Mainnet => "mainnet",
|
Self::Mainnet => "mainnet",
|
||||||
Self::Testnet => "testnet",
|
Self::Testnet => "testnet",
|
||||||
|
|
Loading…
Reference in a new issue