Skip to content

Commit

Permalink
Apply RustRover recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
catuhana committed Jul 3, 2024
1 parent e19c921 commit 92b7bdf
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
10 changes: 5 additions & 5 deletions src/cli/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl NueCommand for CommandArguments {

fn run(&self) -> anyhow::Result<()> {
let progress_bar = indicatif::ProgressBar::new_spinner();
progress_bar.enable_steady_tick(::std::time::Duration::from_millis(120));
progress_bar.enable_steady_tick(std::time::Duration::from_millis(120));

progress_bar.set_message("Fetching releases...");
let releases_json: Vec<types::node::Release> = reqwest::get(
Expand Down Expand Up @@ -98,8 +98,8 @@ impl NueCommand for CommandArguments {
}
}

impl ::std::fmt::Display for VersionInputs {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
impl std::fmt::Display for VersionInputs {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::VersionString(version) => write!(f, "{}", version),
Self::Latest => write!(f, "latest"),
Expand All @@ -109,7 +109,7 @@ impl ::std::fmt::Display for VersionInputs {
}
}

impl ::std::str::FromStr for VersionInputs {
impl std::str::FromStr for VersionInputs {
type Err = anyhow::Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
Expand All @@ -121,7 +121,7 @@ impl ::std::str::FromStr for VersionInputs {
_ if s.starts_with('v') && s[1..].parse::<node_semver::Range>().is_ok() => {
Ok(Self::VersionString(s[1..].to_string()))
}
_ if (s.parse::<node_semver::Range>().is_ok()) => Ok(Self::VersionString(s)),
_ if s.parse::<node_semver::Range>().is_ok() => Ok(Self::VersionString(s)),
_ => Ok(Self::Lts(Some(s))),
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/cli/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl NueCommand for CommandArguments {

fn run(&self) -> anyhow::Result<()> {
let progress_bar = indicatif::ProgressBar::new_spinner();
progress_bar.enable_steady_tick(::std::time::Duration::from_millis(120));
progress_bar.enable_steady_tick(std::time::Duration::from_millis(120));

progress_bar.set_message("Fetching releases...");
let releases_json: Vec<types::node::Release> = reqwest::get(
Expand Down Expand Up @@ -102,8 +102,8 @@ impl NueCommand for CommandArguments {
}
}

impl ::std::fmt::Display for VersionInputs {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
impl std::fmt::Display for VersionInputs {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::VersionString(version) => write!(f, "{}", version),
Self::All => write!(f, "all"),
Expand All @@ -113,7 +113,7 @@ impl ::std::fmt::Display for VersionInputs {
}
}

impl ::std::str::FromStr for VersionInputs {
impl std::str::FromStr for VersionInputs {
type Err = anyhow::Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
Expand All @@ -125,7 +125,7 @@ impl ::std::str::FromStr for VersionInputs {
_ if s.starts_with('v') && s[1..].parse::<node_semver::Range>().is_ok() => {
Ok(Self::VersionString(s[1..].to_string()))
}
_ if (s.parse::<node_semver::Range>().is_ok()) => Ok(Self::VersionString(s)),
_ if s.parse::<node_semver::Range>().is_ok() => Ok(Self::VersionString(s)),
_ => Ok(Self::Lts(Some(s))),
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/types/node/lts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ impl NodeLTS {
}
}

impl ::std::fmt::Display for NodeLTS {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
impl std::fmt::Display for NodeLTS {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::CodeName(code_name) => write!(f, "{}", code_name),
Self::Bool(false) => write!(f, "false"),
Expand All @@ -35,15 +35,15 @@ struct NodeLTSVisitor;
impl<'de> Visitor<'de> for NodeLTSVisitor {
type Value = NodeLTS;

fn expecting(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a string or a boolean")
}

fn visit_str<E>(self, value: &str) -> Result<NodeLTS, E> {
Ok(NodeLTS::CodeName(value.to_string()))
}

fn visit_bool<E>(self, value: bool) -> Result<NodeLTS, E> {
Ok(NodeLTS::Bool(value))
}

fn visit_str<E>(self, value: &str) -> Result<NodeLTS, E> {
Ok(NodeLTS::CodeName(value.to_string()))
}
}
8 changes: 4 additions & 4 deletions src/types/platforms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ impl Platform {
}
}

impl ::std::fmt::Display for Platform {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
impl std::fmt::Display for Platform {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Linux(arch) => write!(f, "linux-{}", arch),
}
Expand All @@ -67,8 +67,8 @@ impl ::std::fmt::Display for Platform {
// }
// }

impl ::std::fmt::Display for Arch {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
impl std::fmt::Display for Arch {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::ARM64 => write!(f, "arm64"),
Self::ARMv7l => write!(f, "armv7l"),
Expand Down

0 comments on commit 92b7bdf

Please sign in to comment.