Skip to content

Commit 49fe17a

Browse files
committed
clippy
1 parent 7bb506b commit 49fe17a

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

src/config.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pub fn get_config_path() -> anyhow::Result<PathBuf> {
175175
Ok(config_dir.join("config.toml"))
176176
}
177177

178-
#[derive(Debug, Serialize, Deserialize, Clone)]
178+
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
179179
pub struct RepoConfig {
180180
pub include: Option<Vec<String>>,
181181
pub exclude: Option<Vec<Exclude>>,
@@ -187,21 +187,6 @@ pub struct RepoConfig {
187187
pub no_ignore: Option<bool>,
188188
}
189189

190-
impl Default for RepoConfig {
191-
fn default() -> Self {
192-
Self {
193-
include: None,
194-
exclude: None,
195-
max_size: None,
196-
max_depth: None,
197-
output: None,
198-
file: None,
199-
hidden: None,
200-
no_ignore: None,
201-
}
202-
}
203-
}
204-
205190
pub fn save_repo_config(path: &Path, repo_config: &RepoConfig) -> anyhow::Result<()> {
206191
let config_str = toml::to_string_pretty(repo_config)?;
207192
std::fs::write(path, config_str)?;

src/main.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,10 @@ fn create_repo_config_from_args(args: &Cli) -> RepoConfig {
181181

182182
RepoConfig {
183183
include: args.include.clone(),
184-
exclude: args.exclude.clone().map(|v| v.clone()),
184+
exclude: args.exclude.clone(),
185185
max_size: args.max_size,
186186
max_depth: args.max_depth,
187-
output: args
188-
.output
189-
.clone()
190-
.map(|o| BackwardsCompatOutputFormat::from(o)),
187+
output: args.output.clone().map(BackwardsCompatOutputFormat::from),
191188
file: args.file.clone(),
192189
hidden: Some(args.hidden),
193190
no_ignore: Some(args.no_ignore),

0 commit comments

Comments
 (0)