History

thanks clippy

Sebastian Thiel committed 3 years ago

Commit bac57dd1 parent e22080e100 files · +172 −230Browse files

Unified · Split

100 files
  1. git-attributes/tests/match_group/mod.rs +1 −1
  2. git-attributes/tests/parse/attribute.rs +1 −1
  3. git-commitgraph/src/file/init.rs +2 −2
  4. git-commitgraph/src/graph/init.rs +1 −1
  5. git-config-value/src/color.rs +1 −1
  6. git-config-value/src/integer.rs +1 −1
  7. git-config/src/file/init/from_env.rs +2 −2
  8. git-config/src/file/mutable/section.rs +2 −2
  9. git-config/src/file/write.rs +1 −1
  10. git-config/src/parse/error.rs +1 −1
  11. git-credentials/src/protocol/context/mod.rs +1 −1
  12. git-credentials/tests/helper/cascade.rs +1 −1
  13. git-credentials/tests/helper/context.rs +4 −6
  14. git-credentials/tests/helper/invoke.rs +1 −1
  15. git-date/src/time/write.rs +1 −1
  16. git-diff/src/tree/visit.rs +1 −2
  17. git-diff/tests/tree/mod.rs +2 −2
  18. git-discover/src/upwards/types.rs +1 −1
  19. git-discover/tests/upwards/mod.rs +3 −11
  20. git-glob/tests/pattern/matching.rs +2 −3
  21. git-hash/src/object_id.rs +2 −2
  22. git-hash/src/oid.rs +1 −1
  23. git-hash/tests/prefix/mod.rs +1 −1
  24. git-lock/src/backoff.rs +3 −8
  25. git-object/tests/object.rs +1 −2
  26. git-odb/src/store_impls/dynamic/find.rs +2 −2
  27. git-odb/src/store_impls/dynamic/header.rs +1 −1
  28. git-pack/src/cache/delta/traverse/mod.rs +1 −1
  29. git-pack/src/cache/lru.rs +2 −2
  30. git-pack/src/cache/object.rs +1 −1
  31. git-pack/src/data/file/init.rs +1 −2
  32. git-pack/src/data/input/entries_to_bytes.rs +2 −2
  33. git-pack/src/data/output/count/objects/mod.rs +1 −1
  34. git-pack/src/data/output/entry/iter_from_counts.rs +1 −1
  35. git-pack/src/index/init.rs +1 −1
  36. git-pack/src/index/traverse/reduce.rs +1 −1
  37. git-pack/src/index/traverse/with_index.rs +1 −1
  38. git-pack/src/index/traverse/with_lookup.rs +2 −2
  39. git-pack/src/index/write/mod.rs +1 −2
  40. git-path/tests/convert/normalize.rs +1 −2
  41. git-pathspec/tests/pathspec.rs +18 −60
  42. git-protocol/src/command/tests.rs +2 −2
  43. git-protocol/src/fetch/arguments/mod.rs +2 −2
  44. git-protocol/src/fetch_fn.rs +1 −1
  45. git-protocol/tests/fetch/response.rs +1 −1
  46. git-protocol/tests/fetch/v1.rs +1 −1
  47. git-protocol/tests/fetch/v2.rs +1 −1
  48. git-ref/src/store/file/loose/reflog.rs +1 −1
  49. git-ref/src/store/file/transaction/prepare.rs +1 −1
  50. git-ref/src/store/packed/transaction.rs +5 −5
  51. git-ref/src/transaction/ext.rs +2 −5
  52. git-ref/tests/file/store/find.rs +1 −1
  53. git-ref/tests/file/store/iter.rs +1 −1
  54. git-ref/tests/file/transaction/prepare_and_commit/create_or_update/collisions.rs +1 −4
  55. git-refspec/tests/matching/mod.rs +7 −14
  56. git-repository/src/clone/fetch/util.rs +1 −0
  57. git-repository/src/clone/mod.rs +1 −0
  58. git-repository/src/config/cache/access.rs +1 −0
  59. git-repository/src/config/cache/incubate.rs +1 −0
  60. git-repository/src/config/cache/init.rs +1 −0
  61. git-repository/src/config/cache/util.rs +2 −1
  62. git-repository/src/config/mod.rs +1 −1
  63. git-repository/src/config/snapshot/access.rs +1 −0
  64. git-repository/src/config/tree/keys.rs +2 −0
  65. git-repository/src/config/tree/sections/core.rs +1 −1
  66. git-repository/src/discover.rs +1 −0
  67. git-repository/src/init.rs +1 −0
  68. git-repository/src/lib.rs +5 −0
  69. git-repository/src/open/mod.rs +1 −3
  70. git-repository/src/open/options.rs +1 −0
  71. git-repository/src/open/repository.rs +1 −0
  72. git-repository/src/reference/edits.rs +1 −0
  73. git-repository/src/remote/connect.rs +1 −0
  74. git-repository/src/remote/connection/fetch/mod.rs +1 −1
  75. git-repository/src/remote/connection/fetch/receive_pack.rs +1 −1
  76. git-repository/src/remote/connection/fetch/update_refs/mod.rs +1 −0
  77. git-repository/src/remote/connection/fetch/update_refs/tests.rs +4 −5
  78. git-repository/src/remote/connection/fetch/update_refs/update.rs +1 −1
  79. git-repository/src/repository/config/transport.rs +4 −3
  80. git-repository/src/repository/object.rs +1 −0
  81. git-repository/src/repository/remote.rs +1 −0
  82. git-repository/src/repository/worktree.rs +1 −0
  83. git-repository/src/revision/spec/parse/error.rs +3 −3
  84. git-repository/src/worktree/proxy.rs +1 −0
  85. git-repository/tests/util/mod.rs +1 −0
  86. git-revision/src/describe.rs +1 −1
  87. git-tempfile/examples/try-deadlock-on-cleanup.rs +3 −4
  88. git-tempfile/src/fs/create_dir.rs +1 −2
  89. git-tempfile/src/fs/remove_dir.rs +1 −4
  90. git-transport/src/client/blocking_io/http/curl/remote.rs +1 −1
  91. git-transport/src/client/blocking_io/http/mod.rs +4 −5
  92. git-transport/src/client/blocking_io/ssh/program_kind.rs +1 −1
  93. git-transport/src/client/blocking_io/traits.rs +2 −2
  94. git-transport/src/client/git/mod.rs +2 −2
  95. git-transport/tests/client/blocking_io/http/mod.rs +3 −3
  96. git-url/src/expand_path.rs +1 −1
  97. git-url/src/lib.rs +1 −1
  98. git-url/tests/expand_path/mod.rs +2 −2
  99. git-worktree/src/fs/cache/state.rs +2 −2
  100. tests/tools/src/lib.rs +1 −1
git-attributes/tests/match_group/mod.rs+1−1
@@ -82,7 +82,7 @@ mod ignore { · 81 unmodified lines
8282 );
8383 }
8484 (None, None) => {}
85− (actual, expected) => panic!("actual {:?} should match {:?} with path '{}'", actual, expected, path),
85+ (actual, expected) => panic!("actual {actual:?} should match {expected:?} with path '{path}'"),
8686 }
8787 }
8888 Ok(())
git-attributes/tests/parse/attribute.rs+1−1
@@ -275,7 +275,7 @@ fn unspecified(attr: &str) -> (BString, StateRef) { · 274 unmodified lines
275275 (attr.into(), StateRef::Unspecified)
276276 }
277277
278−fn value<'a, 'b>(attr: &'a str, value: &'b str) -> (BString, StateRef<'b>) {
278+fn value<'b>(attr: &str, value: &'b str) -> (BString, StateRef<'b>) {
279279 (attr.into(), StateRef::Value(value.as_bytes().as_bstr()))
280280 }
281281
git-commitgraph/src/file/init.rs+2−2
@@ -148,7 +148,7 @@ impl TryFrom<&Path> for File { · 147 unmodified lines
148148 if chunk_size % entry_size != 0 {
149149 return Err(Error::InvalidChunkSize {
150150 id: COMMIT_DATA_CHUNK_ID,
151− msg: format!("chunk size {} is not a multiple of {}", chunk_size, entry_size),
151+ msg: format!("chunk size {chunk_size} is not a multiple of {entry_size}"),
152152 });
153153 }
154154 Ok((
@@ -166,7 +166,7 @@ impl TryFrom<&Path> for File { · 11 unmodified lines
166166 if chunk_size != expected_size {
167167 return Err(Error::InvalidChunkSize {
168168 id: OID_FAN_CHUNK_ID,
169− msg: format!("expected chunk length {}, got {}", expected_size, chunk_size),
169+ msg: format!("expected chunk length {expected_size}, got {chunk_size}"),
170170 });
171171 }
172172 Ok(chunk_range.start)
git-commitgraph/src/graph/init.rs+1−1
@@ -62,7 +62,7 @@ impl Graph { · 61 unmodified lines
6262 err: e,
6363 path: chain_file_path.clone(),
6464 })?;
65− let graph_file_path = commit_graphs_dir.join(format!("graph-{}.graph", hash));
65+ let graph_file_path = commit_graphs_dir.join(format!("graph-{hash}.graph"));
6666 files.push(File::at(&graph_file_path).map_err(|e| Error::File {
6767 err: e,
6868 path: graph_file_path.clone(),
git-config-value/src/color.rs+1−1
@@ -148,7 +148,7 @@ impl Display for Name { · 147 unmodified lines
148148 Self::White => write!(f, "white"),
149149 Self::BrightWhite => write!(f, "brightwhite"),
150150 Self::Ansi(num) => num.fmt(f),
151− Self::Rgb(r, g, b) => write!(f, "#{:02x}{:02x}{:02x}", r, g, b),
151+ Self::Rgb(r, g, b) => write!(f, "#{r:02x}{g:02x}{b:02x}"),
152152 }
153153 }
154154 }
git-config-value/src/integer.rs+1−1
@@ -26,7 +26,7 @@ impl Display for Integer { · 25 unmodified lines
2626 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2727 write!(f, "{}", self.value)?;
2828 if let Some(suffix) = self.suffix {
29− write!(f, "{}", suffix)
29+ write!(f, "{suffix}")
3030 } else {
3131 Ok(())
3232 }
git-config/src/file/init/from_env.rs+2−2
@@ -56,10 +56,10 @@ impl File<'static> { · 55 unmodified lines
5656 let mut config = File::new(meta);
5757 for i in 0..count {
5858 let key = git_path::os_string_into_bstring(
59− env::var_os(format!("GIT_CONFIG_KEY_{}", i)).ok_or(Error::InvalidKeyId { key_id: i })?,
59+ env::var_os(format!("GIT_CONFIG_KEY_{i}")).ok_or(Error::InvalidKeyId { key_id: i })?,
6060 )
6161 .map_err(|_| Error::IllformedUtf8 { index: i, kind: "key" })?;
62− let value = env::var_os(format!("GIT_CONFIG_VALUE_{}", i)).ok_or(Error::InvalidValueId { value_id: i })?;
62+ let value = env::var_os(format!("GIT_CONFIG_VALUE_{i}")).ok_or(Error::InvalidValueId { value_id: i })?;
6363 let key = parse::key(<_ as AsRef<BStr>>::as_ref(&key)).ok_or_else(|| Error::InvalidKeyValue {
6464 key_id: i,
6565 key_val: key.to_string(),
git-config/src/file/mutable/section.rs+2−2
@@ -217,9 +217,9 @@ impl<'a, 'event> SectionMut<'a, 'event> { · 216 unmodified lines
217217 }
218218 }
219219
220− pub(crate) fn get<'key>(
220+ pub(crate) fn get(
221221 &self,
222− key: &Key<'key>,
222+ key: &Key<'_>,
223223 start: Index,
224224 end: Index,
225225 ) -> Result<Cow<'_, BStr>, lookup::existing::Error> {
git-config/src/file/write.rs+1−1
@@ -67,7 +67,7 @@ pub(crate) fn ends_with_newline(e: &[crate::parse::Event<'_>], nl: impl AsRef<[u · 66 unmodified lines
6767 .unwrap_or(false)
6868 }
6969
70−pub(crate) fn extract_newline<'a, 'b>(e: &'a Event<'b>) -> Option<&'a BStr> {
70+pub(crate) fn extract_newline<'a>(e: &'a Event<'_>) -> Option<&'a BStr> {
7171 match e {
7272 Event::Newline(b) => b.as_ref().into(),
7373 _ => None,
git-config/src/parse/error.rs+1−1
@@ -55,7 +55,7 @@ impl Display for Error { · 54 unmodified lines
5555 data_size - 10
5656 )
5757 }
58− (Ok(data), _) => write!(f, "'{}'", data),
58+ (Ok(data), _) => write!(f, "'{data}'"),
5959 (Err(_), _) => self.parsed_until.fmt(f),
6060 }
6161 }
git-credentials/src/protocol/context/mod.rs+1−1
@@ -62,7 +62,7 @@ mod mutate { · 61 unmodified lines
6262 self.host = url.host().map(ToOwned::to_owned).map(|mut host| {
6363 if let Some(port) = url.port {
6464 use std::fmt::Write;
65− write!(host, ":{}", port).expect("infallible");
65+ write!(host, ":{port}").expect("infallible");
6666 }
6767 host
6868 });
git-credentials/tests/helper/cascade.rs+1−1
@@ -163,7 +163,7 @@ mod invoke { · 162 unmodified lines
163163 fn fixtures<'a>(names: impl IntoIterator<Item = &'a str>) -> Vec<Program> {
164164 names
165165 .into_iter()
166− .map(|name| git_path::realpath(fixture_path(format!("{}.sh", name))).unwrap())
166+ .map(|name| git_path::realpath(fixture_path(format!("{name}.sh"))).unwrap())
167167 .map(|path| {
168168 let mut script = git_path::to_unix_separators_on_windows(git_path::into_bstr(path)).into_owned();
169169 script.insert_str(0, "sh ");
git-credentials/tests/helper/context.rs+4−6
@@ -95,21 +95,19 @@ username=bob"; · 94 unmodified lines
9595 #[test]
9696 fn quit_supports_git_config_boolean_values() {
9797 for true_value in ["1", "42", "-42", "true", "on", "yes"] {
98− let input = format!("quit={}", true_value);
98+ let input = format!("quit={true_value}");
9999 assert_eq!(
100100 Context::from_bytes(input.as_bytes()).unwrap().quit,
101101 Some(true),
102− "{}",
103− input
102+ "{input}"
104103 )
105104 }
106105 for false_value in ["0", "false", "off", "no"] {
107− let input = format!("quit={}", false_value);
106+ let input = format!("quit={false_value}");
108107 assert_eq!(
109108 Context::from_bytes(input.as_bytes()).unwrap().quit,
110109 Some(false),
111− "{}",
112− input
110+ "{input}"
113111 )
114112 }
115113 }
git-credentials/tests/helper/invoke.rs+1−1
@@ -126,7 +126,7 @@ mod program { · 125 unmodified lines
126126
127127 pub fn script_helper(name: &str) -> Program {
128128 let mut script = git_path::to_unix_separators_on_windows(git_path::into_bstr(
129− git_path::realpath(fixture_path(format!("{}.sh", name))).unwrap(),
129+ git_path::realpath(fixture_path(format!("{name}.sh"))).unwrap(),
130130 ))
131131 .into_owned();
132132 script.insert_str(0, "sh ");
git-date/src/time/write.rs+1−1
@@ -26,7 +26,7 @@ impl Time { · 25 unmodified lines
2626 const SECONDS_PER_HOUR: i32 = 60 * 60;
2727 let offset = self.offset_in_seconds.abs();
2828 let hours = offset / SECONDS_PER_HOUR;
29− assert!(hours < 25, "offset is more than a day: {}", hours);
29+ assert!(hours < 25, "offset is more than a day: {hours}");
3030 let minutes = (offset - (hours * SECONDS_PER_HOUR)) / 60;
3131
3232 if hours < 10 {
git-diff/src/tree/visit.rs+1−2
@@ -81,8 +81,7 @@ mod tests { · 80 unmodified lines
8181 let actual = std::mem::size_of::<Change>();
8282 assert!(
8383 actual <= 46,
84− "{} <= 46: this type shouldn't grow without us knowing",
85− actual
84+ "{actual} <= 46: this type shouldn't grow without us knowing"
8685 )
8786 }
8887 }
git-diff/tests/tree/mod.rs+2−2
@@ -25,7 +25,7 @@ mod changes { · 24 unmodified lines
2525 ) -> crate::Result<TreeRefIter<'a>> {
2626 let tree_id = db
2727 .try_find(commit, buf)?
28− .ok_or_else(|| format!("start commit {:?} to be present", commit))?
28+ .ok_or_else(|| format!("start commit {commit:?} to be present"))?
2929 .0
3030 .decode()?
3131 .into_commit()
@@ -66,7 +66,7 @@ mod changes { · 34 unmodified lines
6666 let (main_tree_id, parent_commit_id) = {
6767 let commit = db
6868 .try_find(commit_id, &mut buf)?
69− .ok_or_else(|| format!("start commit {:?} to be present", commit_id))?
69+ .ok_or_else(|| format!("start commit {commit_id:?} to be present"))?
7070 .0
7171 .decode()?
7272 .into_commit()
git-discover/src/upwards/types.rs+1−1
@@ -138,7 +138,7 @@ mod tests { · 137 unmodified lines
138138
139139 // Parse & build ceiling dirs string
140140 let symlink_str = symlink_path.to_str().expect("symlink path is valid utf8");
141− let ceiling_dir_string = format!("{}:relative::{}", symlink_str, symlink_str);
141+ let ceiling_dir_string = format!("{symlink_str}:relative::{symlink_str}");
142142 let ceiling_dirs = parse_ceiling_dirs(OsStr::new(ceiling_dir_string.as_str()));
143143
144144 assert_eq!(ceiling_dirs.len(), 2, "Relative path is discarded");
git-discover/tests/upwards/mod.rs+3−11
@@ -316,19 +316,13 @@ mod submodules { · 315 unmodified lines
316316 let (path, _trust) = git_discover::upwards(&submodule_m1_workdir)?;
317317 assert!(
318318 matches!(path, git_discover::repository::Path::LinkedWorkTree{ref work_dir, ref git_dir} if work_dir == &submodule_m1_workdir && git_dir == &submodule_m1_gitdir),
319− "{:?} should match {:?} {:?}",
320− path,
321− submodule_m1_workdir,
322− submodule_m1_gitdir
319+ "{path:?} should match {submodule_m1_workdir:?} {submodule_m1_gitdir:?}"
323320 );
324321
325322 let (path, _trust) = git_discover::upwards(submodule_m1_workdir.join("subdir"))?;
326323 assert!(
327324 matches!(path, git_discover::repository::Path::LinkedWorkTree{ref work_dir, ref git_dir} if work_dir == &submodule_m1_workdir && git_dir == &submodule_m1_gitdir),
328− "{:?} should match {:?} {:?}",
329− path,
330− submodule_m1_workdir,
331− submodule_m1_gitdir
325+ "{path:?} should match {submodule_m1_workdir:?} {submodule_m1_gitdir:?}"
332326 );
333327 }
334328 Ok(())
@@ -343,9 +337,7 @@ mod submodules { · 8 unmodified lines
343337 let (path, _trust) = git_discover::upwards(&submodule_m1_gitdir)?;
344338 assert!(
345339 matches!(path, git_discover::repository::Path::Repository(ref dir) if dir == &submodule_m1_gitdir),
346− "{:?} should match {:?}",
347− path,
348− submodule_m1_gitdir
340+ "{path:?} should match {submodule_m1_gitdir:?}"
349341 );
350342 }
351343 Ok(())
git-glob/tests/pattern/matching.rs+2−3
@@ -61,11 +61,10 @@ fn compare_baseline_with_ours() { · 60 unmodified lines
6161 } in Baseline::new(&input)
6262 {
6363 total_matches += 1;
64− assert!(seen.insert(m), "duplicate match entry: {:?}", m);
64+ assert!(seen.insert(m), "duplicate match entry: {m:?}");
6565 assert_eq!(
6666 is_match, *expected_matches,
67− "baseline for matches must be {} - check baseline and git version: {:?}",
68− expected_matches, m
67+ "baseline for matches must be {expected_matches} - check baseline and git version: {m:?}"
6968 );
7069 match std::panic::catch_unwind(|| {
7170 let pattern = pat(pattern);
git-hash/src/object_id.rs+2−2
@@ -157,7 +157,7 @@ impl std::fmt::Debug for ObjectId { · 156 unmodified lines
157157 ObjectId::Sha1(_hash) => f.write_str("Sha1(")?,
158158 }
159159 for b in self.as_bytes() {
160− write!(f, "{:02x}", b)?;
160+ write!(f, "{b:02x}")?;
161161 }
162162 f.write_str(")")
163163 }
@@ -173,7 +173,7 @@ impl From<&[u8]> for ObjectId { · 9 unmodified lines
173173 fn from(v: &[u8]) -> Self {
174174 match v.len() {
175175 20 => Self::Sha1(v.try_into().expect("prior length validation")),
176− other => panic!("BUG: unsupported hash len: {}", other),
176+ other => panic!("BUG: unsupported hash len: {other}"),
177177 }
178178 }
179179 }
git-hash/src/oid.rs+1−1
@@ -180,7 +180,7 @@ impl<'a> From<&'a [u8; SIZE_OF_SHA1_DIGEST]> for &'a oid { · 179 unmodified lines
180180 impl fmt::Display for &oid {
181181 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
182182 for b in self.as_bytes() {
183− write!(f, "{:02x}", b)?;
183+ write!(f, "{b:02x}")?;
184184 }
185185 Ok(())
186186 }
git-hash/tests/prefix/mod.rs+1−1
@@ -47,7 +47,7 @@ mod new { · 46 unmodified lines
4747 let num_of_zeros = oid.kind().len_in_hex() - hex_len;
4848 expected.extend(std::iter::repeat('0').take(num_of_zeros));
4949 let prefix = git_hash::Prefix::new(oid, hex_len).unwrap();
50− assert_eq!(prefix.as_oid().to_hex().to_string(), expected, "{}", hex_len);
50+ assert_eq!(prefix.as_oid().to_hex().to_string(), expected, "{hex_len}");
5151 assert_eq!(prefix.hex_len(), hex_len);
5252 assert_eq!(prefix.cmp_oid(&oid), Ordering::Equal);
5353 }
git-lock/src/backoff.rs+3−8
@@ -102,21 +102,16 @@ mod tests { · 101 unmodified lines
102102 }
103103 assert!(
104104 actual * 1000 >= (expected - 1) * 750,
105− "value too small: {} < {}",
106− actual,
107− expected
105+ "value too small: {actual} < {expected}"
108106 );
109107 assert!(
110108 actual * 1000 <= (expected + 1) * 1250,
111− "value too big: {} > {}",
112− actual,
113− expected
109+ "value too big: {actual} > {expected}"
114110 );
115111 }
116112 assert!(
117113 num_identities < EXPECTED_TILL_SECOND.len(),
118− "too many untransformed values: {}",
119− num_identities
114+ "too many untransformed values: {num_identities}"
120115 );
121116 }
122117
git-object/tests/object.rs+1−2
@@ -33,8 +33,7 @@ fn size_in_memory() { · 32 unmodified lines
3333 let actual = std::mem::size_of::<git_object::Object>();
3434 assert!(
3535 actual <= 264,
36− "{} <= 264: Prevent unexpected growth of what should be lightweight objects",
37− actual
36+ "{actual} <= 264: Prevent unexpected growth of what should be lightweight objects"
3837 )
3938 }
4039
git-odb/src/store_impls/dynamic/find.rs+2−2
@@ -70,7 +70,7 @@ pub(crate) mod error { · 69 unmodified lines
7070 #[test]
7171 fn error_size() {
7272 let actual = std::mem::size_of::<Error>();
73− assert!(actual <= 88, "{} <= 88: should not grow without us noticing", actual);
73+ assert!(actual <= 88, "{actual} <= 88: should not grow without us noticing");
7474 }
7575 }
7676 }
@@ -219,7 +219,7 @@ where · 142 unmodified lines
219219 }
220220
221221 out.unwrap_or_else(|| {
222− panic!("could not find object {} in any index after looking up one of its base objects {}", id, base_id)
222+ panic!("could not find object {id} in any index after looking up one of its base objects {base_id}" )
223223 })
224224 }
225225 };
git-odb/src/store_impls/dynamic/header.rs+1−1
@@ -119,7 +119,7 @@ where · 118 unmodified lines
119119 }
120120
121121 out.unwrap_or_else(|| {
122− panic!("could not find object {} in any index after looking up one of its base objects {}", id, base_id)
122+ panic!("could not find object {id} in any index after looking up one of its base objects {base_id}")
123123 })
124124 }
125125 };
git-pack/src/cache/delta/traverse/mod.rs+1−1
@@ -143,7 +143,7 @@ where · 142 unmodified lines
143143 (
144144 Vec::<u8>::with_capacity(4096),
145145 lock(&object_progress)
146− .add_child_with_id(format!("thread {}", thread_index), git_features::progress::UNKNOWN),
146+ .add_child_with_id(format!("thread {thread_index}"), git_features::progress::UNKNOWN),
147147 new_thread_state(),
148148 resolve.clone(),
149149 inspect_object.clone(),
git-pack/src/cache/lru.rs+2−2
@@ -40,7 +40,7 @@ mod memory { · 39 unmodified lines
4040 .with_scale(CustomScale),
4141 ),
4242 free_list: Vec::new(),
43− debug: git_features::cache::Debug::new(format!("MemoryCappedHashmap({}B)", memory_cap_in_bytes)),
43+ debug: git_features::cache::Debug::new(format!("MemoryCappedHashmap({memory_cap_in_bytes}B)")),
4444 }
4545 }
4646 }
@@ -113,7 +113,7 @@ mod _static { · 66 unmodified lines
113113 StaticLinkedList {
114114 inner: Default::default(),
115115 free_list: Vec::new(),
116− debug: git_features::cache::Debug::new(format!("StaticLinkedList<{}>", SIZE)),
116+ debug: git_features::cache::Debug::new(format!("StaticLinkedList<{SIZE}>")),
117117 }
118118 }
119119 }
git-pack/src/cache/object.rs+1−1
@@ -49,7 +49,7 @@ mod memory { · 48 unmodified lines
4949 .with_scale(CustomScale),
5050 ),
5151 free_list: Vec::new(),
52− debug: git_features::cache::Debug::new(format!("MemoryCappedObjectHashmap({}B)", memory_cap_in_bytes)),
52+ debug: git_features::cache::Debug::new(format!("MemoryCappedObjectHashmap({memory_cap_in_bytes}B)")),
5353 }
5454 }
5555 }
git-pack/src/data/file/init.rs+1−2
@@ -23,8 +23,7 @@ impl data::File { · 22 unmodified lines
2323 let pack_len = data.len();
2424 if pack_len < N32_SIZE * 3 + hash_len {
2525 return Err(data::header::decode::Error::Corrupt(format!(
26− "Pack data of size {} is too small for even an empty pack with shortest hash",
27− pack_len
26+ "Pack data of size {pack_len} is too small for even an empty pack with shortest hash"
2827 )));
2928 }
3029 let (kind, num_objects) =
git-pack/src/data/input/entries_to_bytes.rs+2−2
@@ -90,11 +90,11 @@ where · 89 unmodified lines
9090 } else {
9191 header_bytes.len() as u64
9292 };
93− self.output.seek(std::io::SeekFrom::Start(0))?;
93+ self.output.rewind()?;
9494 self.output.write_all(&header_bytes[..])?;
9595 self.output.flush()?;
9696
97− self.output.seek(std::io::SeekFrom::Start(0))?;
97+ self.output.rewind()?;
9898 let interrupt_never = std::sync::atomic::AtomicBool::new(false);
9999 let digest = hash::bytes(
100100 &mut self.output,
git-pack/src/data/output/count/objects/mod.rs+1−1
@@ -79,7 +79,7 @@ where · 78 unmodified lines
7979 {
8080 let mut p = progress
8181 .lock()
82− .add_child_with_id(format!("thread {}", n), git_features::progress::UNKNOWN);
82+ .add_child_with_id(format!("thread {n}"), git_features::progress::UNKNOWN);
8383 p.init(None, git_features::progress::count("objects"));
8484 p
8585 },
git-pack/src/data/output/entry/iter_from_counts.rs+1−1
@@ -143,7 +143,7 @@ pub(crate) mod function { · 142 unmodified lines
143143 Vec::new(), // object data buffer
144144 progress
145145 .lock()
146− .add_child_with_id(format!("thread {}", n), git_features::progress::UNKNOWN),
146+ .add_child_with_id(format!("thread {n}"), git_features::progress::UNKNOWN),
147147 )
148148 }
149149 },
git-pack/src/index/init.rs+1−1
@@ -40,7 +40,7 @@ impl index::File { · 39 unmodified lines
4040 let footer_size = hash_len * 2;
4141 if idx_len < FAN_LEN * N32_SIZE + footer_size {
4242 return Err(Error::Corrupt {
43− message: format!("Pack index of size {} is too small for even an empty index", idx_len),
43+ message: format!("Pack index of size {idx_len} is too small for even an empty index"),
4444 });
4545 }
4646 let (kind, fan, num_objects) = {
git-pack/src/index/traverse/reduce.rs+1−1
@@ -76,7 +76,7 @@ where · 75 unmodified lines
7676 fn feed(&mut self, input: Self::Input) -> Result<(), Self::Error> {
7777 let chunk_stats: Vec<_> = match input {
7878 Err(err @ traverse::Error::PackDecode { .. }) if !self.check.fatal_decode_error() => {
79− lock(&self.progress).info(format!("Ignoring decode error: {}", err));
79+ lock(&self.progress).info(format!("Ignoring decode error: {err}"));
8080 return Ok(());
8181 }
8282 res => res,
git-pack/src/index/traverse/with_index.rs+1−1
@@ -150,7 +150,7 @@ impl index::File { · 149 unmodified lines
150150 );
151151 match result {
152152 Err(err @ Error::PackDecode { .. }) if !check.fatal_decode_error() => {
153− progress.info(format!("Ignoring decode error: {}", err));
153+ progress.info(format!("Ignoring decode error: {err}"));
154154 Ok(())
155155 }
156156 res => res,
git-pack/src/index/traverse/with_lookup.rs+2−2
@@ -136,7 +136,7 @@ impl index::File { · 135 unmodified lines
136136 new_processor(),
137137 Vec::with_capacity(2048), // decode buffer
138138 lock(&reduce_progress)
139− .add_child_with_id(format!("thread {}", index), git_features::progress::UNKNOWN), // per thread progress
139+ .add_child_with_id(format!("thread {index}"), git_features::progress::UNKNOWN), // per thread progress
140140 )
141141 }
142142 };
@@ -171,7 +171,7 @@ impl index::File { · 28 unmodified lines
171171 progress.inc();
172172 let stat = match result {
173173 Err(err @ Error::PackDecode { .. }) if !check.fatal_decode_error() => {
174− progress.info(format!("Ignoring decode error: {}", err));
174+ progress.info(format!("Ignoring decode error: {err}"));
175175 continue;
176176 }
177177 res => res,
git-pack/src/index/write/mod.rs+1−2
@@ -170,8 +170,7 @@ impl crate::index::File { · 169 unmodified lines
170170 }
171171 if num_objects != anticipated_num_objects {
172172 objects_progress.info(format!(
173− "{} objects were resolved into {} objects during thin-pack resolution",
174− anticipated_num_objects, num_objects
173+ "{anticipated_num_objects} objects were resolved into {num_objects} objects during thin-pack resolution"
175174 ));
176175 }
177176 let num_objects: u32 = num_objects
git-path/tests/convert/normalize.rs+1−2
@@ -127,8 +127,7 @@ fn trailing_relative_components_are_resolved() { · 126 unmodified lines
127127 assert_eq!(
128128 normalize(path, cwd).unwrap_or_else(|| panic!("{path:?}")),
129129 Cow::Borrowed(p(expected)),
130− "'{}' got an unexpected result",
131− input
130+ "'{input}' got an unexpected result"
132131 );
133132 }
134133 }
git-pathspec/tests/pathspec.rs+18−60
@@ -266,11 +266,7 @@ mod parse { · 265 unmodified lines
266266 fn empty_input() {
267267 let input = "";
268268
269− assert!(
270− !check_against_baseline(input),
271− "This pathspec is valid in git: {}",
272− input
273− );
269+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
274270
275271 let output = git_pathspec::parse(input.as_bytes());
276272 assert!(output.is_err());
@@ -285,11 +281,7 @@ mod parse { · 8 unmodified lines
285281 ];
286282
287283 for input in inputs.into_iter() {
288− assert!(
289− !check_against_baseline(input),
290− "This pathspec is valid in git: {}",
291− input
292− );
284+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
293285
294286 let output = git_pathspec::parse(input.as_bytes());
295287 assert!(output.is_err());
@@ -307,11 +299,7 @@ mod parse { · 11 unmodified lines
307299 ];
308300
309301 for input in inputs.into_iter() {
310− assert!(
311− !check_against_baseline(input),
312− "This pathspec is valid in git: {}",
313− input
314− );
302+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
315303
316304 let output = git_pathspec::parse(input.as_bytes());
317305 assert!(output.is_err());
@@ -329,14 +317,10 @@ mod parse { · 11 unmodified lines
329317 ];
330318
331319 for input in inputs {
332− assert!(
333− !check_against_baseline(input),
334− "This pathspec is valid in git: {}",
335− input
336− );
320+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
337321
338322 let output = git_pathspec::parse(input.as_bytes());
339− assert!(output.is_err(), "This pathspec did not produce an error {}", input);
323+ assert!(output.is_err(), "This pathspec did not produce an error {input}");
340324 assert!(matches!(output.unwrap_err(), Error::InvalidAttribute { .. }));
341325 }
342326 }
@@ -355,18 +339,13 @@ mod parse { · 12 unmodified lines
355339 ];
356340
357341 for input in inputs {
358− assert!(
359− !check_against_baseline(input),
360− "This pathspec is valid in git: {}",
361− input
362− );
342+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
363343
364344 let output = git_pathspec::parse(input.as_bytes());
365− assert!(output.is_err(), "This pathspec did not produce an error {}", input);
345+ assert!(output.is_err(), "This pathspec did not produce an error {input}");
366346 assert!(
367347 matches!(output.unwrap_err(), Error::InvalidAttributeValue { .. }),
368− "Errors did not match for pathspec: {}",
369− input
348+ "Errors did not match for pathspec: {input}"
370349 );
371350 }
372351 }
@@ -380,14 +359,10 @@ mod parse { · 7 unmodified lines
380359 ];
381360
382361 for input in inputs {
383− assert!(
384− !check_against_baseline(input),
385− "This pathspec is valid in git: {}",
386− input
387− );
362+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
388363
389364 let output = git_pathspec::parse(input.as_bytes());
390− assert!(output.is_err(), "This pathspec did not produce an error {}", input);
365+ assert!(output.is_err(), "This pathspec did not produce an error {input}");
391366 assert!(matches!(output.unwrap_err(), Error::TrailingEscapeCharacter));
392367 }
393368 }
@@ -396,11 +371,7 @@ mod parse { · 2 unmodified lines
396371 fn empty_attribute_specification() {
397372 let input = ":(attr:)";
398373
399− assert!(
400− !check_against_baseline(input),
401− "This pathspec is valid in git: {}",
402− input
403− );
374+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
404375
405376 let output = git_pathspec::parse(input.as_bytes());
406377 assert!(output.is_err());
@@ -411,11 +382,7 @@ mod parse { · 4 unmodified lines
411382 fn multiple_attribute_specifications() {
412383 let input = ":(attr:one,attr:two)some/path";
413384
414− assert!(
415− !check_against_baseline(input),
416− "This pathspec is valid in git: {}",
417− input
418− );
385+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
419386
420387 let output = git_pathspec::parse(input.as_bytes());
421388 assert!(output.is_err());
@@ -426,11 +393,7 @@ mod parse { · 4 unmodified lines
426393 fn missing_parentheses() {
427394 let input = ":(top";
428395
429− assert!(
430− !check_against_baseline(input),
431− "This pathspec is valid in git: {}",
432− input
433− );
396+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
434397
435398 let output = git_pathspec::parse(input.as_bytes());
436399 assert!(output.is_err());
@@ -441,11 +404,7 @@ mod parse { · 4 unmodified lines
441404 fn glob_and_literal_keywords_present() {
442405 let input = ":(glob,literal)some/path";
443406
444− assert!(
445− !check_against_baseline(input),
446− "This pathspec is valid in git: {}",
447− input
448− );
407+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
449408
450409 let output = git_pathspec::parse(input.as_bytes());
451410 assert!(output.is_err());
@@ -457,14 +416,13 @@ mod parse { · 5 unmodified lines
457416 for (input, expected) in inputs.into_iter() {
458417 assert!(
459418 check_against_baseline(input),
460− "This pathspec is invalid in git: {}",
461− input
419+ "This pathspec is invalid in git: {input}"
462420 );
463421
464422 let pattern: PatternForTesting = git_pathspec::parse(input.as_bytes())
465− .unwrap_or_else(|_| panic!("parsing should not fail with pathspec {}", input))
423+ .unwrap_or_else(|_| panic!("parsing should not fail with pathspec {input}"))
466424 .into();
467− assert_eq!(pattern, expected, "while checking input: \"{}\"", input);
425+ assert_eq!(pattern, expected, "while checking input: \"{input}\"");
468426 }
469427 }
470428
@@ -509,7 +467,7 @@ mod parse { · 38 unmodified lines
509467 let key: &BStr = pathspec.into();
510468 let base = BASELINE
511469 .get(key)
512− .unwrap_or_else(|| panic!("missing baseline for pathspec: {:?}", pathspec));
470+ .unwrap_or_else(|| panic!("missing baseline for pathspec: {pathspec:?}"));
513471 *base == 0
514472 }
515473 }
git-protocol/src/command/tests.rs+2−2
@@ -1,6 +1,6 @@
11 mod v1 {
22 fn capabilities(input: &str) -> git_transport::client::Capabilities {
3− git_transport::client::Capabilities::from_bytes(format!("\0{}", input).as_bytes())
3+ git_transport::client::Capabilities::from_bytes(format!("\0{input}").as_bytes())
44 .expect("valid input capabilities")
55 .0
66 }
@@ -54,7 +54,7 @@ mod v2 { · 47 unmodified lines
5454 use git_transport::client::Capabilities;
5555
5656 fn capabilities(command: &str, input: &str) -> Capabilities {
57− Capabilities::from_lines(format!("version 2\n{}={}", command, input).into())
57+ Capabilities::from_lines(format!("version 2\n{command}={input}").into())
5858 .expect("valid input for V2 capabilities")
5959 }
6060
git-protocol/src/fetch/arguments/mod.rs+2−2
@@ -157,7 +157,7 @@ impl Arguments { · 156 unmodified lines
157157 }
158158 }
159159 fn prefixed(&mut self, prefix: &str, value: impl fmt::Display) {
160− self.args.push(format!("{}{}", prefix, value).into());
160+ self.args.push(format!("{prefix}{value}").into());
161161 }
162162 /// Create a new instance to help setting up arguments to send to the server as part of a `fetch` operation
163163 /// for which `features` are the available and configured features to use.
@@ -181,7 +181,7 @@ impl Arguments { · 17 unmodified lines
181181 let baked_features = features
182182 .iter()
183183 .map(|(n, v)| match v {
184− Some(v) => format!("{}={}", n, v),
184+ Some(v) => format!("{n}={v}"),
185185 None => n.to_string(),
186186 })
187187 .collect::<Vec<_>>();
git-protocol/src/fetch_fn.rs+1−1
@@ -123,7 +123,7 @@ where · 122 unmodified lines
123123 let mut round = 1;
124124 'negotiation: loop {
125125 progress.step();
126− progress.set_name(format!("negotiate (round {})", round));
126+ progress.set_name(format!("negotiate (round {round})"));
127127 round += 1;
128128 let action = delegate.negotiate(&refs, &mut arguments, previous_response.as_ref())?;
129129 let mut reader = arguments.send(&mut transport, action == Action::Cancel).await?;
git-protocol/tests/fetch/response.rs+1−1
@@ -214,7 +214,7 @@ mod v2 { · 213 unmodified lines
214214 fetch::response::Error::UploadPack(err) => {
215215 assert_eq!(err.message, "segmentation fault\n")
216216 }
217− err => panic!("we expect upload pack errors, got {:#?}", err),
217+ err => panic!("we expect upload pack errors, got {err:#?}"),
218218 },
219219 }
220220 }
git-protocol/tests/fetch/v1.rs+1−1
@@ -28,7 +28,7 @@ async fn clone() -> crate::Result { · 27 unmodified lines
2828 "agent",
2929 )
3030 .await?;
31− assert_eq!(dlg.pack_bytes, 876, "{}: It be able to read pack bytes", fixture);
31+ assert_eq!(dlg.pack_bytes, 876, "{fixture}: It be able to read pack bytes");
3232 }
3333 Ok(())
3434 }
git-protocol/tests/fetch/v2.rs+1−1
@@ -140,7 +140,7 @@ async fn ls_remote_abort_in_prep_ls_refs() -> crate::Result { · 139 unmodified lines
140140 assert_eq!(err.kind(), std::io::ErrorKind::Other);
141141 assert_eq!(err.get_ref().expect("other error").to_string(), "hello world");
142142 }
143− err => panic!("should not have another error here, got: {}", err),
143+ err => panic!("should not have another error here, got: {err}"),
144144 }
145145 Ok(())
146146 }
git-ref/src/store/file/loose/reflog.rs+1−1
@@ -156,7 +156,7 @@ pub mod create_or_update { · 155 unmodified lines
156156 .and_then(|_| committer.write_to(&mut file))
157157 .and_then(|_| {
158158 if !message.is_empty() {
159− writeln!(file, "\t{}", message)
159+ writeln!(file, "\t{message}")
160160 } else {
161161 writeln!(file)
162162 }
git-ref/src/store/file/transaction/prepare.rs+1−1
@@ -183,7 +183,7 @@ impl<'s, 'p> Transaction<'s, 'p> { · 182 unmodified lines
183183 let mut lock = lock.take().map(Ok).unwrap_or_else(obtain_lock)?;
184184
185185 lock.with_mut(|file| match new {
186− Target::Peeled(oid) => write!(file, "{}", oid),
186+ Target::Peeled(oid) => write!(file, "{oid}"),
187187 Target::Symbolic(name) => write!(file, "ref: {}", name.0),
188188 })?;
189189 Some(lock.close()?)
git-ref/src/store/packed/transaction.rs+5−5
@@ -81,7 +81,7 @@ impl packed::Transaction { · 80 unmodified lines
8181 Some(kind) if kind == git_object::Kind::Tag => {
8282 next_id = git_object::TagRefIter::from_bytes(&buf).target_id().map_err(|_| {
8383 prepare::Error::Resolve(
84− format!("Couldn't get target object id from tag {}", next_id).into(),
84+ format!("Couldn't get target object id from tag {next_id}").into(),
8585 )
8686 })?;
8787 }
@@ -90,7 +90,7 @@ impl packed::Transaction { · 2 unmodified lines
9090 }
9191 None => {
9292 return Err(prepare::Error::Resolve(
93− format!("Couldn't find object with id {}", next_id).into(),
93+ format!("Couldn't find object with id {next_id}").into(),
9494 ))
9595 }
9696 }
@@ -194,7 +194,7 @@ fn write_packed_ref(mut out: impl std::io::Write, pref: packed::Reference<'_>) - · 97 unmodified lines
194194 out.write_all(pref.name.as_bstr())?;
195195 out.write_all(b"\n")?;
196196 if let Some(object) = pref.object {
197− writeln!(out, "^{}", object)?;
197+ writeln!(out, "^{object}")?;
198198 }
199199 Ok(())
200200 }
@@ -206,11 +206,11 @@ fn write_edit(mut out: impl std::io::Write, edit: &Edit, lines_written: &mut i32 · 5 unmodified lines
206206 new: Target::Peeled(target_oid),
207207 ..
208208 } => {
209− write!(out, "{} ", target_oid)?;
209+ write!(out, "{target_oid} ")?;
210210 out.write_all(edit.inner.name.as_bstr())?;
211211 out.write_all(b"\n")?;
212212 if let Some(object) = edit.peeled {
213− writeln!(out, "^{}", object)?;
213+ writeln!(out, "^{object}")?;
214214 }
215215 *lines_written += 1;
216216 }
git-ref/src/transaction/ext.rs+2−5
@@ -34,7 +34,7 @@ where · 33 unmodified lines
3434 self.assure_one_name_has_one_edit().map_err(|name| {
3535 std::io::Error::new(
3636 std::io::ErrorKind::AlreadyExists,
37− format!("A reference named '{}' has multiple edits", name),
37+ format!("A reference named '{name}' has multiple edits"),
3838 )
3939 })
4040 }
@@ -121,10 +121,7 @@ where · 80 unmodified lines
121121 if round == 5 {
122122 break Err(std::io::Error::new(
123123 std::io::ErrorKind::WouldBlock,
124− format!(
125− "Could not follow all splits after {} rounds, assuming reference cycle",
126− round
127− ),
124+ format!("Could not follow all splits after {round} rounds, assuming reference cycle"),
128125 ));
129126 }
130127 round += 1;
git-ref/tests/file/store/find.rs+1−1
@@ -109,7 +109,7 @@ mod loose { · 108 unmodified lines
109109 Err(git_ref::file::find::existing::Error::NotFound { name }) => {
110110 assert_eq!(name, Path::new(*partial_name));
111111 }
112− Err(err) => panic!("Unexpected err: {:?}", err),
112+ Err(err) => panic!("Unexpected err: {err:?}"),
113113 },
114114 }
115115 }
git-ref/tests/file/store/iter.rs+1−1
@@ -302,7 +302,7 @@ fn loose_iter_with_broken_refs() -> crate::Result { · 301 unmodified lines
302302 "tags/t1"
303303 ]
304304 .into_iter()
305− .map(|p| format!("refs/{}", p))
305+ .map(|p| format!("refs/{p}"))
306306 .collect::<Vec<_>>(),
307307 "all paths are as expected"
308308 );
git-ref/tests/file/transaction/prepare_and_commit/create_or_update/collisions.rs+1−4
@@ -30,10 +30,7 @@ fn conflicting_creation_without_packed_refs() -> crate::Result { · 29 unmodified lines
3030 match res {
3131 Ok(_) if case_sensitive => {}
3232 Ok(_) if !case_sensitive => panic!("should fail as 'a' and 'A' clash"),
33− Err(err) if case_sensitive => panic!(
34− "should work as case sensitivity allows 'a' and 'A' to coexist: {:?}",
35− err
36− ),
33+ Err(err) if case_sensitive => panic!("should work as case sensitivity allows 'a' and 'A' to coexist: {err:?}"),
3734 Err(err) if !case_sensitive => {
3835 assert_eq!(err.to_string(), "A lock could not be obtained for reference \"refs/A\"")
3936 }
git-refspec/tests/matching/mod.rs+7−14
@@ -113,10 +113,10 @@ pub mod baseline { · 112 unmodified lines
113113 Err(e) if e.to_string() == err => {
114114 saw_err = true;
115115 }
116− Err(err) => panic!("Unexpected parse error: {:?}", err),
116+ Err(err) => panic!("Unexpected parse error: {err:?}"),
117117 }
118118 }
119− assert!(saw_err, "Failed to see error when parsing specs: {:?}", err)
119+ assert!(saw_err, "Failed to see error when parsing specs: {err:?}")
120120 }
121121
122122 /// Here we checked by hand which refs are actually written with a particular refspec
@@ -143,7 +143,7 @@ pub mod baseline { · 20 unmodified lines
143143 let key: Vec<_> = specs.into_iter().map(BString::from).collect();
144144 let expected = BASELINE
145145 .get(&key)
146− .unwrap_or_else(|| panic!("BUG: Need {:?} added to the baseline", key))
146+ .unwrap_or_else(|| panic!("BUG: Need {key:?} added to the baseline"))
147147 .as_ref();
148148
149149 let actual = match_group.match_remotes(input()).validated();
@@ -175,22 +175,15 @@ pub mod baseline { · 25 unmodified lines
175175 assert_eq!(
176176 actual.len(),
177177 expected.len(),
178− "got a different amount of mappings: {:?} != {:?}",
179− actual,
180− expected
178+ "got a different amount of mappings: {actual:?} != {expected:?}"
181179 );
182180
183181 for (idx, (actual, expected)) in actual.iter().zip(expected).enumerate() {
184− assert_eq!(
185− source_to_bstring(actual.lhs),
186− expected.remote,
187− "{}: remote mismatch",
188− idx
189− );
182+ assert_eq!(source_to_bstring(actual.lhs), expected.remote, "{idx}: remote mismatch");
190183 if let Some(expected) = expected.local.as_ref() {
191184 match actual.rhs.as_ref() {
192− None => panic!("{}: Expected local ref to be {}, got none", idx, expected),
193− Some(actual) => assert_eq!(actual.as_ref(), expected, "{}: mismatched local ref", idx),
185+ None => panic!("{idx}: Expected local ref to be {expected}, got none"),
186+ Some(actual) => assert_eq!(actual.as_ref(), expected, "{idx}: mismatched local ref"),
194187 }
195188 }
196189 }
git-repository/src/clone/fetch/util.rs+1−0
@@ -12,6 +12,7 @@ use crate::{ · 11 unmodified lines
1212 Repository,
1313 };
1414
15+#[allow(clippy::result_large_err)]
1516 pub fn write_remote_to_local_config_file(
1617 remote: &mut crate::Remote<'_>,
1718 remote_name: BString,
git-repository/src/clone/mod.rs+1−0
@@ -1,3 +1,4 @@
1+#![allow(clippy::result_large_err)]
12 use std::convert::TryInto;
23
34 use crate::bstr::BString;
git-repository/src/config/cache/access.rs+1−0
@@ -1,3 +1,4 @@
1+#![allow(clippy::result_large_err)]
12 use std::{borrow::Cow, path::PathBuf, time::Duration};
23
34 use git_lock::acquire::Fail;
git-repository/src/config/cache/incubate.rs+1−0
@@ -1,3 +1,4 @@
1+#![allow(clippy::result_large_err)]
12 use super::{util, Error};
23 use crate::config::tree::{Core, Extensions};
34
git-repository/src/config/cache/init.rs+1−0
@@ -1,3 +1,4 @@
1+#![allow(clippy::result_large_err)]
12 use std::borrow::Cow;
23
34 use git_sec::Permission;
git-repository/src/config/cache/util.rs+2−1
@@ -1,3 +1,4 @@
1+#![allow(clippy::result_large_err)]
12 use super::Error;
23 use crate::{
34 config,
@@ -102,7 +103,7 @@ pub(crate) fn disambiguate_hint( · 98 unmodified lines
102103 lenient_config: bool,
103104 ) -> Result<Option<ObjectKindHint>, config::key::GenericErrorWithValue> {
104105 match config.string_by_key("core.disambiguate") {
105− None => return Ok(None),
106+ None => Ok(None),
106107 Some(value) => Core::DISAMBIGUATE
107108 .try_into_object_kind_hint(value)
108109 .with_leniency(lenient_config),
git-repository/src/config/mod.rs+1−1
@@ -124,7 +124,7 @@ pub mod protocol { · 123 unmodified lines
124124 /// The error returned when obtaining the permission for a particular scheme.
125125 #[derive(Debug, thiserror::Error)]
126126 #[allow(missing_docs)]
127− #[error("The value {value:?} must be allow|deny|user in configuration key protocol{0}.allow", scheme.as_ref().map(|s| format!(".{}", s)).unwrap_or_default())]
127+ #[error("The value {value:?} must be allow|deny|user in configuration key protocol{0}.allow", scheme.as_ref().map(|s| format!(".{s}")).unwrap_or_default())]
128128 pub struct Error {
129129 pub scheme: Option<String>,
130130 pub value: BString,
git-repository/src/config/snapshot/access.rs+1−0
@@ -1,3 +1,4 @@
1+#![allow(clippy::result_large_err)]
12 use std::borrow::Cow;
23
34 use git_features::threading::OwnShared;
git-repository/src/config/tree/keys.rs+2−0
@@ -1,3 +1,4 @@
1+#![allow(clippy::result_large_err)]
12 use std::{
23 borrow::Cow,
34 error::Error,
@@ -452,6 +453,7 @@ mod remote_name { · 448 unmodified lines
452453 }
453454
454455 /// Try to validate `name` as symbolic remote name and return it.
456+ #[allow(clippy::result_large_err)]
455457 pub fn try_into_symbolic_name(
456458 &'static self,
457459 name: Cow<'_, BStr>,
git-repository/src/config/tree/sections/core.rs+1−1
@@ -115,7 +115,7 @@ mod disambiguate { · 114 unmodified lines
115115
116116 impl Disambiguate {
117117 /// Convert a disambiguation marker into the respective enum.
118− pub fn try_into_object_kind_hint<'a>(
118+ pub fn try_into_object_kind_hint(
119119 &'static self,
120120 value: Cow<'_, BStr>,
121121 ) -> Result<Option<ObjectKindHint>, config::key::GenericErrorWithValue> {
git-repository/src/discover.rs+1−0
@@ -1,3 +1,4 @@
1+#![allow(clippy::result_large_err)]
12 use std::path::Path;
23
34 pub use git_discover::*;
git-repository/src/init.rs+1−0
@@ -1,3 +1,4 @@
1+#![allow(clippy::result_large_err)]
12 use std::{borrow::Cow, convert::TryInto, path::Path};
23
34 use git_ref::{
git-repository/src/lib.rs+5−0
@@ -140,16 +140,19 @@ pub mod progress { · 139 unmodified lines
140140 }
141141
142142 /// See [ThreadSafeRepository::discover()], but returns a [`Repository`] instead.
143+#[allow(clippy::result_large_err)]
143144 pub fn discover(directory: impl AsRef<std::path::Path>) -> Result<Repository, discover::Error> {
144145 ThreadSafeRepository::discover(directory).map(Into::into)
145146 }
146147
147148 /// See [ThreadSafeRepository::init()], but returns a [`Repository`] instead.
149+#[allow(clippy::result_large_err)]
148150 pub fn init(directory: impl AsRef<std::path::Path>) -> Result<Repository, init::Error> {
149151 ThreadSafeRepository::init(directory, create::Kind::WithWorktree, create::Options::default()).map(Into::into)
150152 }
151153
152154 /// See [ThreadSafeRepository::init()], but returns a [`Repository`] instead.
155+#[allow(clippy::result_large_err)]
153156 pub fn init_bare(directory: impl AsRef<std::path::Path>) -> Result<Repository, init::Error> {
154157 ThreadSafeRepository::init(directory, create::Kind::Bare, create::Options::default()).map(Into::into)
155158 }
@@ -203,11 +206,13 @@ fn open_opts_with_git_binary_config() -> open::Options { · 47 unmodified lines
203206 }
204207
205208 /// See [ThreadSafeRepository::open()], but returns a [`Repository`] instead.
209+#[allow(clippy::result_large_err)]
206210 pub fn open(directory: impl Into<std::path::PathBuf>) -> Result<Repository, open::Error> {
207211 ThreadSafeRepository::open(directory).map(Into::into)
208212 }
209213
210214 /// See [ThreadSafeRepository::open_opts()], but returns a [`Repository`] instead.
215+#[allow(clippy::result_large_err)]
211216 pub fn open_opts(directory: impl Into<std::path::PathBuf>, options: open::Options) -> Result<Repository, open::Error> {
212217 ThreadSafeRepository::open_opts(directory, options).map(Into::into)
213218 }
git-repository/src/open/mod.rs+1−3
@@ -61,9 +61,7 @@ mod tests { · 60 unmodified lines
6161 let limit = 160;
6262 assert!(
6363 actual <= limit,
64− "{} <= {}: size shouldn't change without us knowing (on windows, it's bigger)",
65− actual,
66− limit
64+ "{actual} <= {limit}: size shouldn't change without us knowing (on windows, it's bigger)"
6765 );
6866 }
6967 }
git-repository/src/open/options.rs+1−0
@@ -140,6 +140,7 @@ impl Options { · 139 unmodified lines
140140 }
141141
142142 /// Open a repository at `path` with the options set so far.
143+ #[allow(clippy::result_large_err)]
143144 pub fn open(self, path: impl Into<PathBuf>) -> Result<ThreadSafeRepository, Error> {
144145 ThreadSafeRepository::open_opts(path, self)
145146 }
git-repository/src/open/repository.rs+1−0
@@ -1,3 +1,4 @@
1+#![allow(clippy::result_large_err)]
12 use std::{borrow::Cow, path::PathBuf};
23
34 use git_features::threading::OwnShared;
git-repository/src/reference/edits.rs+1−0
@@ -27,6 +27,7 @@ pub mod set_target_id { · 26 unmodified lines
2727 /// Furthermore, refrain from using this method for more than a one-off change as it creates a transaction for each invocation.
2828 /// If multiple reference should be changed, use [Repository::edit_references()][crate::Repository::edit_references()]
2929 /// or the lower level reference database instead.
30+ #[allow(clippy::result_large_err)]
3031 pub fn set_target_id(
3132 &mut self,
3233 id: impl Into<git_hash::ObjectId>,
git-repository/src/remote/connect.rs+1−0
@@ -1,3 +1,4 @@
1+#![allow(clippy::result_large_err)]
12 use git_protocol::transport::client::Transport;
23
34 use crate::{remote::Connection, Progress, Remote};
git-repository/src/remote/connection/fetch/mod.rs+1−1
@@ -32,7 +32,7 @@ pub enum RefLogMessage { · 31 unmodified lines
3232 impl RefLogMessage {
3333 pub(crate) fn compose(&self, context: &str) -> BString {
3434 match self {
35− RefLogMessage::Prefixed { action } => format!("{}: {}", action, context).into(),
35+ RefLogMessage::Prefixed { action } => format!("{action}: {context}").into(),
3636 RefLogMessage::Override { message } => message.to_owned(),
3737 }
3838 }
git-repository/src/remote/connection/fetch/receive_pack.rs+1−1
@@ -98,7 +98,7 @@ where · 97 unmodified lines
9898
9999 let reader = 'negotiation: loop {
100100 progress.step();
101− progress.set_name(format!("negotiate (round {})", round));
101+ progress.set_name(format!("negotiate (round {round})"));
102102
103103 let is_done = match negotiate::one_round(
104104 negotiate::Algorithm::Naive,
git-repository/src/remote/connection/fetch/update_refs/mod.rs+1−0
@@ -1,3 +1,4 @@
1+#![allow(clippy::result_large_err)]
12 use std::{collections::BTreeMap, convert::TryInto, path::PathBuf};
23
34 use git_odb::{Find, FindExt};
git-repository/src/remote/connection/fetch/update_refs/tests.rs+4−5
@@ -160,9 +160,8 @@ mod update { · 159 unmodified lines
160160 Change::Update { log, new, .. } => {
161161 assert_eq!(
162162 log.message,
163− format!("action: {}", reflog_message),
164− "{}: reflog messages are specific and we emulate git word for word",
165− spec
163+ format!("action: {reflog_message}"),
164+ "{spec}: reflog messages are specific and we emulate git word for word"
166165 );
167166 let remote_ref = repo
168167 .find_reference(specs[0].to_ref().source().expect("always present"))
@@ -195,7 +194,7 @@ mod update { · 26 unmodified lines
195194 ("wt-c-locked", "wt-c-locked"),
196195 ("wt-deleted", "wt-deleted"),
197196 ] {
198− let spec = format!("refs/heads/main:refs/heads/{}", branch);
197+ let spec = format!("refs/heads/main:refs/heads/{branch}");
199198 let (mappings, specs) = mapping_from_spec(&spec, &repo);
200199 let out = fetch::refs::update(
201200 &repo,
@@ -216,7 +215,7 @@ mod update { · 14 unmodified lines
216215 },
217216 edit_index: None,
218217 }],
219− "{}: checked-out checks are done before checking if a change would actually be required (here it isn't)", spec
218+ "{spec}: checked-out checks are done before checking if a change would actually be required (here it isn't)"
220219 );
221220 assert_eq!(out.edits.len(), 0);
222221 }
git-repository/src/remote/connection/fetch/update_refs/update.rs+1−1
@@ -81,7 +81,7 @@ impl std::fmt::Display for Mode { · 80 unmodified lines
8181 Mode::Forced => "forced-update",
8282 Mode::New => "new",
8383 Mode::ImplicitTagNotSentByRemote => "unrelated tag on remote",
84− Mode::RejectedSourceObjectNotFound { id } => return write!(f, "rejected ({} not found)", id),
84+ Mode::RejectedSourceObjectNotFound { id } => return write!(f, "rejected ({id} not found)"),
8585 Mode::RejectedTagUpdate => "rejected (would overwrite existing tag)",
8686 Mode::RejectedNonFastForward => "rejected (non-fast-forward)",
8787 Mode::RejectedSymbolic => "rejected (refusing to write symbolic refs)",
git-repository/src/repository/config/transport.rs+4−3
@@ -1,3 +1,4 @@
1+#![allow(clippy::result_large_err)]
12 use std::any::Any;
23
34 use crate::bstr::BStr;
@@ -170,7 +171,7 @@ impl crate::Repository { · 166 unmodified lines
170171 .with_leniency(lenient)
171172 },
172173 )
173− .map_err(|err| config::transport::http::Error::InvalidFollowRedirects(err))?
174+ .map_err(config::transport::http::Error::InvalidFollowRedirects)?
174175 };
175176
176177 opts.low_speed_time_seconds = config
@@ -178,14 +179,14 @@ impl crate::Repository { · 1 unmodified line
178179 .map(|value| config::tree::Http::LOW_SPEED_TIME.try_into_u64(value))
179180 .transpose()
180181 .with_leniency(lenient)
181− .map_err(|err| config::transport::http::Error::from(err))?
182+ .map_err(config::transport::http::Error::from)?
182183 .unwrap_or_default();
183184 opts.low_speed_limit_bytes_per_second = config
184185 .integer_filter_by_key("http.lowSpeedLimit", &mut trusted_only)
185186 .map(|value| config::tree::Http::LOW_SPEED_LIMIT.try_into_u32(value))
186187 .transpose()
187188 .with_leniency(lenient)
188− .map_err(|err| config::transport::http::Error::from(err))?
189+ .map_err(config::transport::http::Error::from)?
189190 .unwrap_or_default();
190191 opts.proxy = proxy(
191192 remote_name
git-repository/src/repository/object.rs+1−0
@@ -1,3 +1,4 @@
1+#![allow(clippy::result_large_err)]
12 use std::convert::TryInto;
23
34 use git_hash::ObjectId;
git-repository/src/repository/remote.rs+1−0
@@ -1,3 +1,4 @@
1+#![allow(clippy::result_large_err)]
12 use std::convert::TryInto;
23
34 use crate::{bstr::BStr, config, remote, remote::find, Remote};
git-repository/src/repository/worktree.rs+1−0
@@ -33,6 +33,7 @@ impl crate::Repository { · 32 unmodified lines
3333 ///
3434 /// Note that it might be the one that is currently open if this repository doesn't point to a linked worktree.
3535 /// Also note that the main repo might be bare.
36+ #[allow(clippy::result_large_err)]
3637 pub fn main_repo(&self) -> Result<crate::Repository, crate::open::Error> {
3738 crate::ThreadSafeRepository::open_opts(self.common_dir(), self.options.clone()).map(Into::into)
3839 }
git-repository/src/revision/spec/parse/error.rs+3−3
@@ -35,11 +35,11 @@ pub enum CandidateInfo { · 34 unmodified lines
3535 impl std::fmt::Display for CandidateInfo {
3636 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3737 match self {
38− CandidateInfo::FindError { source } => write!(f, "lookup error: {}", source),
39− CandidateInfo::Tag { name } => write!(f, "tag {:?}", name),
38+ CandidateInfo::FindError { source } => write!(f, "lookup error: {source}"),
39+ CandidateInfo::Tag { name } => write!(f, "tag {name:?}"),
4040 CandidateInfo::Object { kind } => std::fmt::Display::fmt(kind, f),
4141 CandidateInfo::Commit { date, title } => {
42− write!(f, "commit {} {:?}", date.format(git_date::time::format::SHORT), title)
42+ write!(f, "commit {} {title:?}", date.format(git_date::time::format::SHORT))
4343 }
4444 }
4545 }
git-repository/src/worktree/proxy.rs+1−0
@@ -1,3 +1,4 @@
1+#![allow(clippy::result_large_err)]
12 use std::path::{Path, PathBuf};
23
34 use crate::{
git-repository/tests/util/mod.rs+1−0
@@ -1,3 +1,4 @@
1+#![allow(clippy::result_large_err)]
12 use git_repository::{open, Repository, ThreadSafeRepository};
23 use git_testtools::tempfile;
34
git-revision/src/describe.rs+1−1
@@ -88,7 +88,7 @@ impl<'a> Display for Format<'a> { · 87 unmodified lines
8888 }
8989
9090 if let Some(suffix) = &self.dirty_suffix {
91− write!(f, "-{}", suffix)?;
91+ write!(f, "-{suffix}")?;
9292 }
9393 Ok(())
9494 }
git-tempfile/examples/try-deadlock-on-cleanup.rs+3−4
@@ -66,11 +66,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { · 65 unmodified lines
6666 );
6767 }
6868 if let Err(err) = tmp.close() {
69− eprintln!("Error when removing tempdir: {}", err);
69+ eprintln!("Error when removing tempdir: {err}");
7070 }
7171 eprintln!(
72− "OK: survived {}s without deadlock with {} tempfiles created, lock obtained {} times, cleanup handler ran {} times",
73− secs_to_run,
72+ "OK: survived {secs_to_run}s without deadlock with {} tempfiles created, lock obtained {} times, cleanup handler ran {} times",
7473 tempfiles_created.load(Ordering::SeqCst),
7574 tempfiles_registry_locked.load(Ordering::SeqCst),
7675 signal_raised.load(Ordering::SeqCst)
@@ -88,7 +87,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { · 11 unmodified lines
8887
8988 fn tempfile_for_thread_or_panic(tid: i32, tmp: &Path, count: &AtomicUsize) -> Handle<Writable> {
9089 let res = git_tempfile::writable_at(
91− tmp.join(format!("thread-{}", tid)),
90+ tmp.join(format!("thread-{tid}")),
9291 ContainingDirectory::Exists,
9392 AutoRemove::Tempfile,
9493 )
git-tempfile/src/fs/create_dir.rs+1−2
@@ -63,8 +63,7 @@ mod error { · 62 unmodified lines
6363 retries,
6464 } => write!(
6565 f,
66− "Permanently failing to create directory {:?} ({:?} of {:?})",
67− dir, retries_left, retries
66+ "Permanently failing to create directory {dir:?} ({retries_left:?} of {retries:?})",
6867 ),
6968 }
7069 }
git-tempfile/src/fs/remove_dir.rs+1−4
@@ -20,10 +20,7 @@ impl<'a> Iter<'a> { · 19 unmodified lines
2020 if !target.starts_with(boundary) {
2121 return Err(std::io::Error::new(
2222 std::io::ErrorKind::InvalidInput,
23− format!(
24− "Removal target {:?} must be contained in boundary {:?}",
25− target, boundary
26− ),
23+ format!("Removal target {target:?} must be contained in boundary {boundary:?}"),
2724 ));
2825 }
2926 let cursor = if target == boundary {
git-transport/src/client/blocking_io/http/curl/remote.rs+1−1
@@ -54,7 +54,7 @@ impl Handler { · 53 unmodified lines
5454 };
5555 match Self::parse_status_inner(data) {
5656 Ok(status) if !(200..=valid_end).contains(&status) => {
57− Some((status, format!("Received HTTP status {}", status).into()))
57+ Some((status, format!("Received HTTP status {status}").into()))
5858 }
5959 Ok(_) => None,
6060 Err(err) => Some((500, err)),
git-transport/src/client/blocking_io/http/mod.rs+4−5
@@ -252,8 +252,7 @@ impl<H: Http> Transport<H> { · 251 unmodified lines
252252 }) {
253253 return Err(client::Error::Http(Error::Detail {
254254 description: format!(
255− "Didn't find '{}' header to indicate 'smart' protocol, and 'dumb' protocol is not supported.",
256− wanted_content_type
255+ "Didn't find '{wanted_content_type}' header to indicate 'smart' protocol, and 'dumb' protocol is not supported."
257256 ),
258257 }));
259258 }
@@ -271,7 +270,7 @@ impl<H: Http> Transport<H> { · 11 unmodified lines
271270 }
272271 headers.push(Cow::Owned(format!(
273272 "Authorization: Basic {}",
274− base64::engine::general_purpose::STANDARD.encode(format!("{}:{}", username, password))
273+ base64::engine::general_purpose::STANDARD.encode(format!("{username}:{password}"))
275274 )))
276275 }
277276 Ok(())
@@ -377,13 +376,13 @@ impl<H: Http> client::Transport for Transport<H> { · 99 unmodified lines
377376 &extra_parameters
378377 .iter()
379378 .map(|(key, value)| match value {
380− Some(value) => format!("{}={}", key, value),
379+ Some(value) => format!("{key}={value}"),
381380 None => key.to_string(),
382381 })
383382 .collect::<Vec<_>>()
384383 .join(":"),
385384 );
386− dynamic_headers.push(format!("Git-Protocol: {}", parameters).into());
385+ dynamic_headers.push(format!("Git-Protocol: {parameters}").into());
387386 }
388387 self.add_basic_auth_if_present(&mut dynamic_headers)?;
389388 let GetResponse { headers, body } =
git-transport/src/client/blocking_io/ssh/program_kind.rs+1−1
@@ -40,7 +40,7 @@ impl ProgramKind { · 39 unmodified lines
4040 .env("GIT_PROTOCOL", format!("version={}", desired_version as usize))
4141 }
4242 if let Some(port) = url.port {
43− prepare = prepare.arg(format!("-p{}", port));
43+ prepare = prepare.arg(format!("-p{port}"));
4444 }
4545 }
4646 ProgramKind::Plink | ProgramKind::Putty | ProgramKind::TortoisePlink => {
git-transport/src/client/blocking_io/traits.rs+2−2
@@ -83,10 +83,10 @@ impl<T: Transport> TransportV2Ext for T { · 82 unmodified lines
8383 arguments: Option<impl Iterator<Item = BString>>,
8484 ) -> Result<Box<dyn ExtendedBufRead + Unpin + '_>, Error> {
8585 let mut writer = self.request(WriteMode::OneLfTerminatedLinePerWriteCall, MessageKind::Flush)?;
86− writer.write_all(format!("command={}", command).as_bytes())?;
86+ writer.write_all(format!("command={command}").as_bytes())?;
8787 for (name, value) in capabilities {
8888 match value {
89− Some(value) => writer.write_all(format!("{}={}", name, value.as_ref()).as_bytes()),
89+ Some(value) => writer.write_all(format!("{name}={}", value.as_ref()).as_bytes()),
9090 None => writer.write_all(name.as_bytes()),
9191 }?;
9292 }
git-transport/src/client/git/mod.rs+2−2
@@ -64,7 +64,7 @@ mod message { · 63 unmodified lines
6464 out.extend_from_slice(host.as_bytes());
6565 if let Some(port) = port {
6666 out.push_byte(b':');
67− out.push_str(&format!("{}", port));
67+ out.push_str(&format!("{port}"));
6868 }
6969 out.push(0);
7070 }
@@ -87,7 +87,7 @@ mod message { · 16 unmodified lines
8787 }
8888 for (key, value) in extra_parameters {
8989 match value {
90− Some(value) => out.push_str(format!("{}={}", key, value)),
90+ Some(value) => out.push_str(format!("{key}={value}")),
9191 None => out.push_str(key),
9292 }
9393 out.push(0);
git-transport/tests/client/blocking_io/http/mod.rs+3−3
@@ -23,18 +23,18 @@ fn assert_error_status( · 22 unmodified lines
2323 kind: std::io::ErrorKind,
2424 ) -> Result<(mock::Server, http::Transport<http::Impl>), crate::Error> {
2525 let (server, mut client) =
26− mock::serve_and_connect(&format!("http-{}.response", status), "path/not-important", Protocol::V1)?;
26+ mock::serve_and_connect(&format!("http-{status}.response"), "path/not-important", Protocol::V1)?;
2727 let error = client
2828 .handshake(Service::UploadPack, &[])
2929 .err()
3030 .expect("non-200 status causes error");
3131 let error = error
3232 .source()
33− .unwrap_or_else(|| panic!("no source() in: {:?} ", error))
33+ .unwrap_or_else(|| panic!("no source() in: {error:?} "))
3434 .downcast_ref::<std::io::Error>()
3535 .expect("io error as source");
3636 assert_eq!(error.kind(), kind);
37− let expected = format!("Received HTTP status {}", status);
37+ let expected = format!("Received HTTP status {status}");
3838 assert_eq!(error.to_string().get(..expected.len()), Some(expected).as_deref());
3939 drop(server.received());
4040 Ok((server, client))
git-url/src/expand_path.rs+1−1
@@ -28,7 +28,7 @@ impl From<ForUser> for Option<BString> { · 27 unmodified lines
2828 pub enum Error {
2929 #[error("UTF8 conversion on non-unix system failed for path: {path:?}")]
3030 IllformedUtf8 { path: BString },
31− #[error("Home directory could not be obtained for {}", match user {Some(user) => format!("user '{}'", user), None => "current user".into()})]
31+ #[error("Home directory could not be obtained for {}", match user {Some(user) => format!("user '{user}'"), None => "current user".into()})]
3232 MissingHome { user: Option<BString> },
3333 }
3434
git-url/src/lib.rs+1−1
@@ -188,7 +188,7 @@ impl Url { · 187 unmodified lines
188188 (Some(_user), None) => unreachable!("BUG: should not be possible to have a user but no host"),
189189 };
190190 if let Some(port) = &self.port {
191− write!(&mut out, ":{}", port)?;
191+ write!(&mut out, ":{port}")?;
192192 }
193193 if self.serialize_alternative_form && self.scheme == Scheme::Ssh {
194194 out.write_all(b":")?;
git-url/tests/expand_path/mod.rs+2−2
@@ -21,7 +21,7 @@ fn user_home(name: &str) -> std::path::PathBuf { · 20 unmodified lines
2121 #[cfg(not(windows))]
2222 fn user_home(name: &str) -> std::path::PathBuf {
2323 #[cfg(not(windows))]
24− format!("/home/{}", name).into()
24+ format!("/home/{name}").into()
2525 }
2626
2727 #[test]
@@ -29,7 +29,7 @@ fn without_username() -> crate::Result { · 1 unmodified line
2929 let (user, resolved_path) = expand_path::parse(b"/~/hello/git".as_bstr())?;
3030 let resolved_path = expand_path::with(user.as_ref(), resolved_path.as_ref(), |user: &ForUser| match user {
3131 ForUser::Current => Some(user_home("byron")),
32− ForUser::Name(name) => Some(format!("/home/{}", name).into()),
32+ ForUser::Name(name) => Some(format!("/home/{name}").into()),
3333 })?;
3434 assert_eq!(resolved_path, expected_path());
3535 Ok(())
git-worktree/src/fs/cache/state.rs+2−2
@@ -231,10 +231,10 @@ impl State { · 230 unmodified lines
231231 /// - ignores entries which aren't blobs
232232 /// - ignores ignore entries which are not skip-worktree
233233 /// - within merges, picks 'our' stage both for ignore and attribute files.
234− pub fn build_attribute_list<'paths>(
234+ pub fn build_attribute_list(
235235 &self,
236236 index: &git_index::State,
237− paths: &'paths git_index::PathStorageRef,
237+ paths: &git_index::PathStorageRef,
238238 case: Case,
239239 ) -> Vec<PathOidMapping> {
240240 let a1_backing;
tests/tools/src/lib.rs+1−1
@@ -183,7 +183,7 @@ pub fn spawn_git_daemon(working_dir: impl AsRef<Path>) -> std::io::Result<GitDae · 182 unmodified lines
183183 }
184184 Ok(GitDaemon {
185185 child,
186− url: format!("git://{}", server_addr),
186+ url: format!("git://{server_addr}"),
187187 })
188188 }
189189