Skip to content

Commit

Permalink
Organise imports
Browse files Browse the repository at this point in the history
  • Loading branch information
catuhana committed Jul 2, 2024
1 parent 81145de commit 6ede4fe
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
9 changes: 4 additions & 5 deletions src/cli/install.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use std::{fmt, str};

use clap::Args;

use super::NueCommand;

use crate::{exts::HyperlinkExt, types};

#[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord)]
Expand Down Expand Up @@ -88,8 +87,8 @@ impl NueCommand for CommandArguments {
}
}

impl fmt::Display for VersionInputs {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> 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 @@ -99,7 +98,7 @@ impl 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 Down
10 changes: 5 additions & 5 deletions src/cli/list.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use clap::Args;

use crate::{exts::HyperlinkExt, types};

use super::NueCommand;

use crate::{exts::HyperlinkExt, types};

#[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord)]
enum VersionInputs {
VersionString(String),
Expand Down Expand Up @@ -123,8 +123,8 @@ fn print_version_tree(releases: &[types::node::Release]) -> String {
tree_string
}

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 @@ -134,7 +134,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 Down
4 changes: 2 additions & 2 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use clap::{Args, Parser, Subcommand};

mod install;
mod list;

use clap::{Args, Parser, Subcommand};

pub trait NueCommand {
type Arguments: Args;

Expand Down
2 changes: 1 addition & 1 deletion src/types/node/lts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ 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")
}

Expand Down
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 6ede4fe

Please sign in to comment.