mirror of
https://git.ghostchain.io/proxmio/ghost-node.git
synced 2025-12-27 11:19:57 +00:00
rustfmt ghost client cli and fix typos
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
@@ -21,19 +21,25 @@ pub struct InnerSs58AddressFormat(Ss58AddressFormat);
|
||||
impl InnerSs58AddressFormat {
|
||||
#[inline]
|
||||
pub fn custom(prefix: u16) -> Self {
|
||||
Self { 0: Ss58AddressFormat::custom(prefix) }
|
||||
Self {
|
||||
0: Ss58AddressFormat::custom(prefix),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for InnerSs58AddressFormat {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
write!(f, "{} network", ALL_POSSIBLE_IDS
|
||||
.binary_search(&u16::from(self.0))
|
||||
.expect("always be found"))
|
||||
write!(
|
||||
f,
|
||||
"{} network",
|
||||
ALL_POSSIBLE_IDS
|
||||
.binary_search(&u16::from(self.0))
|
||||
.expect("always be found")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a>TryFrom<&'a str> for InnerSs58AddressFormat {
|
||||
impl<'a> TryFrom<&'a str> for InnerSs58AddressFormat {
|
||||
type Error = ParseError;
|
||||
|
||||
fn try_from(x: &'a str) -> Result<Self, Self::Error> {
|
||||
@@ -44,13 +50,13 @@ impl<'a>TryFrom<&'a str> for InnerSs58AddressFormat {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn parse_s58_prefix_address_format(x: &str,) -> Result<Ss58AddressFormat, String> {
|
||||
pub fn parse_s58_prefix_address_format(x: &str) -> Result<Ss58AddressFormat, String> {
|
||||
match InnerSs58AddressFormat::try_from(x) {
|
||||
Ok(format_registry) => Ok(format_registry.0.into()),
|
||||
Err(_) => Err(format!(
|
||||
"Unable to parse variant. Known variants: {:?}",
|
||||
&ALL_POSSIBLE_NAMES
|
||||
))
|
||||
)),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user