Skip to content

Commit baaeb60

Browse files
committed
chore(lint): use #[derive(Default)] & re-format
1 parent 01188bf commit baaeb60

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

src/cli/color_choice.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,17 @@ use std::str::FromStr;
66
use thiserror::Error;
77

88
/// Whether messages should use color output.
9-
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Default)]
1010
pub enum ColorChoice {
1111
/// Force color output.
1212
Always,
1313
/// Intelligently guess whether to use color output.
14+
#[default]
1415
Auto,
1516
/// Force disable color output.
1617
Never,
1718
}
1819

19-
impl Default for ColorChoice {
20-
fn default() -> Self {
21-
Self::Auto
22-
}
23-
}
24-
2520
impl fmt::Display for ColorChoice {
2621
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2722
match self {

src/context/mod.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,14 @@ pub struct Output {
4747
}
4848

4949
/// The requested verbosity of output.
50-
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd)]
50+
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Default)]
5151
pub enum Verbosity {
5252
Quiet,
53+
#[default]
5354
Normal,
5455
Verbose,
5556
}
5657

57-
impl Default for Verbosity {
58-
fn default() -> Self {
59-
Self::Normal
60-
}
61-
}
62-
6358
impl Context {
6459
/// The location of the configuration directory.
6560
pub fn config_dir(&self) -> &Path {

src/util/git.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ where
3333
))
3434
});
3535

36-
// Prefer proxies set in Git config, then fallback to auto detection that will use environment variables.
36+
// Prefer proxies set in Git config,
37+
// otherwise fallback to auto detection which uses environment variables.
3738
let mut proxy_opts = git2::ProxyOptions::new();
3839
if let Some(proxy_url) = proxy_url_from_git_config() {
3940
proxy_opts.url(&proxy_url);

0 commit comments

Comments
 (0)