Skip to content

Commit 4f221f7

Browse files
committed
cargo fmt and cargo clippy
1 parent a3e0a5d commit 4f221f7

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn run() -> Result<()> {
1616
let _ = ansi_term::enable_ansi_support();
1717

1818
if !is_git_installed() {
19-
return Err("Git failed to execute!".into());
19+
return Err("git failed to execute!".into());
2020
}
2121

2222
let config = Cli::new()?;

src/onefetch/ascii_art.rs

+3-12
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,13 @@ impl std::fmt::Display for Token {
6565
}
6666
impl Token {
6767
fn is_solid(&self) -> bool {
68-
match *self {
69-
Token::Char(_) => true,
70-
_ => false,
71-
}
68+
matches!(*self, Token::Char(_))
7269
}
7370
fn is_space(&self) -> bool {
74-
match *self {
75-
Token::Space => true,
76-
_ => false,
77-
}
71+
matches!(*self, Token::Space)
7872
}
7973
fn has_zero_width(&self) -> bool {
80-
match *self {
81-
Token::Color(_) => true,
82-
_ => false,
83-
}
74+
matches!(*self, Token::Color(_))
8475
}
8576
}
8677

src/onefetch/cli_utils.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ impl<W: Write> Printer<W> {
8888
}
8989

9090
pub fn is_valid_repo(repo_path: &str) -> Result<bool> {
91-
let repo =
92-
Repository::open_ext(repo_path, RepositoryOpenFlags::empty(), Vec::<&Path>::new());
91+
let repo = Repository::open_ext(repo_path, RepositoryOpenFlags::empty(), Vec::<&Path>::new());
9392

9493
Ok(repo.is_ok() && !repo?.is_bare())
9594
}

0 commit comments

Comments
 (0)