Skip to content

Commit 6f009d7

Browse files
committed
thanks clippy
1 parent 8c00e6f commit 6f009d7

File tree

38 files changed

+117
-109
lines changed

38 files changed

+117
-109
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,3 +377,7 @@ no_effect_underscore_binding = "allow" # x1
377377
empty_docs = "allow"
378378
too_long_first_doc_paragraph = "allow"
379379
large_stack_arrays = "allow"
380+
381+
# Fix one day
382+
result_large_err = "allow"
383+
large_enum_variant = "allow"

gitoxide-core/src/corpus/engine.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ impl Engine {
5757
let repos = self.refresh_repos(&corpus_path, corpus_id)?;
5858
self.state.progress.set_name("refresh repos".into());
5959
self.state.progress.info(format!(
60-
"Added or updated {} repositories under {corpus_path:?}",
61-
repos.len()
60+
"Added or updated {} repositories under '{corpus_path}'",
61+
repos.len(),
62+
corpus_path = corpus_path.display(),
6263
));
6364
Ok(())
6465
}
@@ -316,7 +317,7 @@ impl Engine {
316317
out.push(repo);
317318
progress.inc();
318319
}
319-
Err(err) => progress.fail(format!("{repo_path:?}: {err:#?}")),
320+
Err(err) => progress.fail(format!("{repo_path}: {err:#?}", repo_path = repo_path.display())),
320321
}
321322
}
322323
statement.finalize()?;

gitoxide-core/src/hours/core.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,11 @@ pub fn spawn_tree_delta_threads<'scope>(
166166
(true, true) => {
167167
files.modified += 1;
168168
if let Some(cache) = cache.as_mut() {
169-
let mut diff = change.diff(cache).map_err(|err| {
170-
std::io::Error::new(std::io::ErrorKind::Other, err)
171-
})?;
169+
let mut diff = change.diff(cache).map_err(std::io::Error::other)?;
172170
let mut nl = 0;
173-
if let Some(counts) = diff.line_counts().map_err(|err| {
174-
std::io::Error::new(std::io::ErrorKind::Other, err)
175-
})? {
171+
if let Some(counts) =
172+
diff.line_counts().map_err(std::io::Error::other)?
173+
{
176174
nl += counts.insertions as usize + counts.removals as usize;
177175
lines.added += counts.insertions as usize;
178176
lines.removed += counts.removals as usize;

gitoxide-core/src/organize.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ fn handle(
138138

139139
if let Some(parent_repo_path) = find_parent_repo(git_workdir) {
140140
progress.fail(format!(
141-
"Skipping repository at {:?} as it is nested within repository {:?}",
141+
"Skipping repository at '{}' as it is nested within repository '{}'",
142142
git_workdir.display(),
143-
parent_repo_path
143+
parent_repo_path.display()
144144
));
145145
return Ok(());
146146
}
@@ -157,7 +157,7 @@ fn handle(
157157
};
158158
if url.path.is_empty() {
159159
progress.info(format!(
160-
"Skipping repository at {:?} whose remote does not have a path: {:?}",
160+
"Skipping repository at '{}' whose remote does not have a path: {}",
161161
git_workdir.display(),
162162
url.to_bstring()
163163
));

gitoxide-core/src/pack/receive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ fn receive_pack_blocking(
294294
None::<gix::objs::find::Never>,
295295
options,
296296
)
297-
.map_err(|err| io::Error::new(io::ErrorKind::Other, err))?;
297+
.map_err(io::Error::other)?;
298298

299299
if let Some(directory) = refs_directory.take() {
300300
write_raw_refs(refs, directory)?;

gitoxide-core/src/query/db.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ pub fn create(path: impl AsRef<std::path::Path>) -> anyhow::Result<rusqlite::Con
1919
}
2020
Some(version) if version != VERSION => match con.close() {
2121
Ok(()) => {
22-
std::fs::remove_file(path)
23-
.with_context(|| format!("Failed to remove incompatible database file at {path:?}"))?;
22+
std::fs::remove_file(path).with_context(|| {
23+
format!(
24+
"Failed to remove incompatible database file at {path}",
25+
path = path.display()
26+
)
27+
})?;
2428
con = rusqlite::Connection::open(path)?;
2529
con.execute_batch(meta_table)?;
2630
con.execute("INSERT into meta(version) values(?)", params![VERSION])?;

gitoxide-core/src/repository/attributes/validate_baseline.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ pub(crate) mod function {
4444
if repo.is_bare() {
4545
writeln!(
4646
err,
47-
"Repo {:?} is bare - disabling git-ignore baseline as `git check-ignore` needs a worktree",
48-
repo.path()
47+
"Repo at '{repo}' is bare - disabling git-ignore baseline as `git check-ignore` needs a worktree",
48+
repo = repo.path().display()
4949
)
5050
.ok();
5151
ignore = false;

gitoxide-core/src/repository/fetch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ pub(crate) mod function {
169169

170170
let start = std::time::Instant::now();
171171
progress.set_name("layout graph".into());
172-
progress.info(format!("writing {path:?}…"));
172+
progress.info(format!("writing {}…", path.display()));
173173
let mut svg = SVGWriter::new();
174174
vg.do_it(false, false, false, &mut svg);
175175
std::fs::write(path, svg.finalize().as_bytes())?;

gitoxide-core/src/repository/revision/list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pub(crate) mod function {
117117
if let Some((mut vg, path, _)) = vg {
118118
let start = std::time::Instant::now();
119119
progress.set_name("layout graph".into());
120-
progress.info(format!("writing {path:?}…"));
120+
progress.info(format!("writing {}…", path.display()));
121121
let mut svg = SVGWriter::new();
122122
vg.do_it(false, false, false, &mut svg);
123123
std::fs::write(&path, svg.finalize().as_bytes())?;

gix-config/tests/config/file/init/from_paths/includes/conditional/gitdir/util.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ pub fn assert_section_value(
142142
Some(Value::Override) => Some(cow_str("override-value")),
143143
None => None,
144144
},
145-
"gix-config disagrees with the expected value, {:?} for debugging",
146-
env.tempdir.into_path()
145+
"gix-config disagrees with the expected value, {} for debugging",
146+
env.tempdir.into_path().display()
147147
);
148148
assure_git_agrees(expected, env)
149149
}
@@ -171,9 +171,9 @@ fn assure_git_agrees(expected: Option<Value>, env: GitEnv) -> crate::Result {
171171
assert_eq!(
172172
output.status.success(),
173173
expected.is_some(),
174-
"{:?}, {:?} for debugging",
174+
"{:?}, {} for debugging",
175175
output,
176-
env.tempdir.into_path()
176+
env.tempdir.into_path().display()
177177
);
178178
let git_output: BString = output.stdout.trim_end().into();
179179
assert_eq!(

0 commit comments

Comments
 (0)