Skip to content

Commit 66a5ae1

Browse files
committed
Drop trailing , just before ) on same line in function calls
These appear unintentional, and in most cases may have been introduced before rustfmt collapsed the lines, or with the idea that they would cause rustfmt to expand the lines but where that did not occur, or in an earlier version of the code where the last argument was longer and thus split onto another line. This does not remove a trailing `,` after the same argument when the argument is on its own line. Although this does remove trailing `,` in some macro calls (e.g., `format!`), this of course avoids making such changes in macro definitions, where `,)` is semantic.
1 parent d1b357e commit 66a5ae1

File tree

37 files changed

+63
-63
lines changed

37 files changed

+63
-63
lines changed

gix-attributes/tests/parse/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ fn exclamation_marks_must_be_escaped_or_error_unlike_gitignore() {
117117

118118
#[test]
119119
fn invalid_escapes_in_quotes_are_an_error() {
120-
assert!(matches!(try_line(r#""\!hello""#), Err(parse::Error::Unquote(_)),),);
120+
assert!(matches!(try_line(r#""\!hello""#), Err(parse::Error::Unquote(_))));
121121
assert!(lenient_lines(r#""\!hello""#).is_empty());
122122
}
123123

gix-config/tests/config/file/access/read_only.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fn get_value_for_all_provided_values() -> crate::Result {
8787
&[cow_str("")],
8888
"unset values show up as empty within a string array"
8989
);
90-
assert_eq!(config.strings("core.bool-implicit").expect("present"), &[cow_str("")],);
90+
assert_eq!(config.strings("core.bool-implicit").expect("present"), &[cow_str("")]);
9191

9292
assert_eq!(config.string("doesn't.exist"), None);
9393

gix-config/tests/config/file/init/comfort.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn from_git_dir() -> crate::Result {
4444
"value",
4545
"a value from the local repo configuration"
4646
);
47-
assert_eq!(config.string("a.local").expect("present").as_ref(), "value",);
47+
assert_eq!(config.string("a.local").expect("present").as_ref(), "value");
4848
assert_eq!(
4949
config.string_by("a", None, "local-include").expect("present").as_ref(),
5050
"from-a.config",

gix-config/tests/config/key/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn valid_and_invalid() {
2121
assert_eq!(key.value_name, "baz");
2222

2323
let key = r"includeIf.gitdir/i:C:\bare.git.path".as_key();
24-
assert_eq!(key.subsection_name, Some(r"gitdir/i:C:\bare.git".into()),);
24+
assert_eq!(key.subsection_name, Some(r"gitdir/i:C:\bare.git".into()));
2525
}
2626

2727
mod _ref {

gix-config/tests/config/source/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn git_config_no_system() {
4343
_ => unreachable!("known set"),
4444
}
4545
})
46-
.is_some(),);
46+
.is_some());
4747
}
4848

4949
#[test]

gix-config/tests/config/value/normalize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fn quotes_right_next_to_each_other() {
4949
#[test]
5050
fn escaped_quotes_are_kept() {
5151
let cow = normalize_bstr(r#""hello \"\" world""#);
52-
assert_eq!(cow, cow_str("hello \"\" world").clone(),);
52+
assert_eq!(cow, cow_str("hello \"\" world").clone());
5353
assert!(matches!(cow, Cow::Owned(_)));
5454
}
5555

gix-diff/tests/diff/index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ fn renames_by_similarity_with_limit() -> crate::Result {
312312
"fuzzy tracking is effectively disabled due to limit"
313313
);
314314
let actual: Vec<_> = changes.iter().map(|c| c.fields().0).collect();
315-
assert_eq!(actual, ["f1", "f1-renamed", "f2", "f2-renamed"],);
315+
assert_eq!(actual, ["f1", "f1-renamed", "f2", "f2-renamed"]);
316316

317317
let out = out.expect("tracking enabled");
318318
assert_eq!(out.num_similarity_checks, 0);

gix-diff/tests/diff/tree_with_rewrites.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ fn renames_by_similarity_with_limit() -> crate::Result {
422422
"fuzzy tracking is effectively disabled due to limit"
423423
);
424424
let actual: Vec<_> = changes.iter().map(Change::location).collect();
425-
assert_eq!(actual, ["f1", "f1-renamed", "f2", "f2-renamed"],);
425+
assert_eq!(actual, ["f1", "f1-renamed", "f2", "f2-renamed"]);
426426

427427
let out = out.expect("tracking enabled");
428428
assert_eq!(out.num_similarity_checks, 0);

gix-dir/tests/dir/walk.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,8 +2166,8 @@ fn untracked_and_ignored_collapse_handling_for_deletion_with_wildcards() -> crat
21662166
entryps("c.o", Ignored(Expendable), File, WildcardMatch),
21672167
entryps("d/a.o", Ignored(Expendable), File, WildcardMatch),
21682168
entryps("d/b.o", Ignored(Expendable), File, WildcardMatch),
2169-
entryps("d/d/a.o", Ignored(Expendable), File, WildcardMatch,),
2170-
entryps("d/d/b.o", Ignored(Expendable), File, WildcardMatch,),
2169+
entryps("d/d/a.o", Ignored(Expendable), File, WildcardMatch),
2170+
entryps("d/d/b.o", Ignored(Expendable), File, WildcardMatch),
21712171
entryps("generated/a.o", Ignored(Expendable), File, WildcardMatch),
21722172
entryps("objs", Ignored(Expendable), Directory, WildcardMatch),
21732173
],
@@ -2213,7 +2213,7 @@ fn untracked_and_ignored_collapse_handling_for_deletion_with_wildcards() -> crat
22132213
entryps("c.o", Ignored(Expendable), File, WildcardMatch),
22142214
entryps("d/a.o", Ignored(Expendable), File, WildcardMatch),
22152215
entryps("d/b.o", Ignored(Expendable), File, WildcardMatch),
2216-
entryps("d/d", Untracked, Directory, WildcardMatch,),
2216+
entryps("d/d", Untracked, Directory, WildcardMatch),
22172217
entryps_dirstat("d/d/a.o", Ignored(Expendable), File, WildcardMatch, Untracked),
22182218
entryps_dirstat("d/d/b.o", Ignored(Expendable), File, WildcardMatch, Untracked),
22192219
entryps_dirstat(

gix-discover/tests/discover/upwards/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ fn from_working_dir_no_config() -> crate::Result {
9898
for name in ["worktree-no-config-after-init", "worktree-no-config"] {
9999
let dir = repo_path()?.join(name);
100100
let (path, trust) = gix_discover::upwards(&dir)?;
101-
assert_eq!(path.kind(), Kind::WorkTree { linked_git_dir: None },);
101+
assert_eq!(path.kind(), Kind::WorkTree { linked_git_dir: None });
102102
assert_eq!(path.as_ref(), dir, "a working tree dir yields the git dir");
103103
assert_eq!(trust, expected_trust());
104104
}

gix-index/tests/index/entry/stat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ mod matches {
9595
);
9696
stat2.ctime.secs = 1;
9797
assert!(
98-
stat1.matches(&stat2, Options::default(),),
98+
stat1.matches(&stat2, Options::default()),
9999
"ctime seconds are the same so stat matches (trust_ctime=true,use_nsec=false)"
100100
);
101101
assert!(

gix-index/tests/index/file/init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ mod from_state {
5656
index.write(gix_index::write::Options::default())?;
5757
assert!(index.checksum().is_some(), "checksum is adjusted after writing");
5858
assert!(index.path().is_file());
59-
assert_eq!(index.version(), expected_version,);
59+
assert_eq!(index.version(), expected_version);
6060

6161
index.verify_integrity()?;
6262
}

gix-index/tests/index/file/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ fn compare_states(actual: &State, actual_version: Version, expected: &State, opt
261261
expected.entries().len(),
262262
"entry count mismatch in {fixture:?}",
263263
);
264-
assert_eq!(actual.entries(), expected.entries(), "entries mismatch in {fixture:?}",);
264+
assert_eq!(actual.entries(), expected.entries(), "entries mismatch in {fixture:?}");
265265
assert_eq!(
266266
actual.path_backing(),
267267
expected.path_backing(),

gix-merge/src/tree/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub fn unique_path_in_tree(
7878
let mut suffix = 0;
7979
while editor.get(to_components_bstring_ref(&buf)).is_some() || tree.check_conflict(buf.as_bstr()).is_some() {
8080
buf.truncate(base_len);
81-
buf.push_str(format!("_{suffix}",));
81+
buf.push_str(format!("_{suffix}"));
8282
suffix += 1;
8383
}
8484
Ok(buf)

gix-merge/tests/merge/blob/builtin_driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ mod text {
161161
num_diverging += 1;
162162
} else {
163163
if case.expected.contains_str("<<<<<<<") {
164-
assert_eq!(actual, Resolution::Conflict, "{}: resolution mismatch", case.name,);
164+
assert_eq!(actual, Resolution::Conflict, "{}: resolution mismatch", case.name);
165165
} else {
166166
assert!(
167167
matches!(

gix-merge/tests/merge/blob/platform.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ theirs
463463

464464
let mut input = imara_diff::intern::InternedInput::new(&[][..], &[]);
465465
assert_eq!(
466-
platform_ref.builtin_merge(BuiltinDriver::Text, &mut out, &mut input, Default::default(),),
466+
platform_ref.builtin_merge(BuiltinDriver::Text, &mut out, &mut input, Default::default()),
467467
res,
468468
"we can't enforce it, it will just default to using binary"
469469
);
@@ -689,7 +689,7 @@ mod prepare_merge {
689689
},
690690
)?;
691691
let expected_idx = 1;
692-
assert_eq!(prepared.driver, DriverChoice::Index(expected_idx),);
692+
assert_eq!(prepared.driver, DriverChoice::Index(expected_idx));
693693
assert_eq!(
694694
prepared.options.resolve_binary_with,
695695
Some(builtin_driver::binary::ResolveWith::Ours),

gix-pack/src/data/input/entry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn compress_data(obj: &gix_object::Data<'_>) -> Result<Vec<u8>, input::Error> {
5656
match err.kind() {
5757
std::io::ErrorKind::Other => return Err(input::Error::Io(err)),
5858
err => {
59-
unreachable!("Should never see other errors than zlib, but got {:?}", err,)
59+
unreachable!("Should never see other errors than zlib, but got {:?}", err)
6060
}
6161
}
6262
}

gix-pack/src/data/output/entry/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl output::Entry {
142142
if let Err(err) = std::io::copy(&mut &*obj.data, &mut out) {
143143
match err.kind() {
144144
std::io::ErrorKind::Other => return Err(Error::ZlibDeflate(err)),
145-
err => unreachable!("Should never see other errors than zlib, but got {:?}", err,),
145+
err => unreachable!("Should never see other errors than zlib, but got {:?}", err),
146146
}
147147
}
148148
out.flush()?;

gix-ref/src/store/packed/decode/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ mod reference {
1717
#[test]
1818
fn invalid() {
1919
assert!(decode::reference::<()>
20-
.parse_peek(b"# what looks like a comment",)
20+
.parse_peek(b"# what looks like a comment")
2121
.is_err());
2222
assert!(
2323
decode::reference::<()>
24-
.parse_peek(b"^e9cdc958e7ce2290e2d7958cdb5aa9323ef35d37\n",)
24+
.parse_peek(b"^e9cdc958e7ce2290e2d7958cdb5aa9323ef35d37\n")
2525
.is_err(),
2626
"lonely peel"
2727
);

gix-ref/tests/refs/file/store/iter.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ mod with_namespace {
7373
);
7474
assert_eq!(
7575
store
76-
.find(fullname.as_bstr().splitn_str(2, b"/").nth(1).expect("name").as_bstr(),)?
76+
.find(fullname.as_bstr().splitn_str(2, b"/").nth(1).expect("name").as_bstr())?
7777
.name,
7878
fullname,
7979
"it will find namespaced items just by their shortened (but not shortest) name"
8080
);
8181
assert!(
8282
store
83-
.try_find(reference.name_without_namespace(&ns_two).expect("namespaced"),)?
83+
.try_find(reference.name_without_namespace(&ns_two).expect("namespaced"))?
8484
.is_none(),
8585
"it won't find namespaced items by their full name without namespace"
8686
);
@@ -167,7 +167,7 @@ mod with_namespace {
167167

168168
for fullname in ref_names {
169169
assert_eq!(
170-
ns_store.find(fullname.as_bstr(),)?.name,
170+
ns_store.find(fullname.as_bstr())?.name,
171171
fullname,
172172
"it finds namespaced items by fully qualified name, excluding namespace"
173173
);
@@ -179,7 +179,7 @@ mod with_namespace {
179179
);
180180
assert_eq!(
181181
ns_store
182-
.find(fullname.as_bstr().splitn_str(2, b"/").nth(1).expect("name").as_bstr(),)?
182+
.find(fullname.as_bstr().splitn_str(2, b"/").nth(1).expect("name").as_bstr())?
183183
.name,
184184
fullname,
185185
"it finds partial names within the namespace"
@@ -372,7 +372,7 @@ fn loose_iter_with_partial_prefix() -> crate::Result {
372372

373373
assert_eq!(
374374
actual,
375-
vec!["refs/heads/d1", "refs/heads/dt1",]
375+
vec!["refs/heads/d1", "refs/heads/dt1"]
376376
.into_iter()
377377
.map(String::from)
378378
.collect::<Vec<_>>(),

gix-ref/tests/refs/file/transaction/prepare_and_commit/create_or_update/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ fn write_reference_to_which_head_points_to_does_not_update_heads_reflog_even_tho
683683
},
684684
expected: PreviousValue::MustExistAndMatch(Target::Object(hex_to_id(
685685
"02a7a22d90d7c02fb494ed25551850b868e634f0"
686-
)),),
686+
))),
687687
new: Target::Object(new_id),
688688
},
689689
name: referent.as_bstr().try_into()?,

gix-ref/tests/refs/file/transaction/prepare_and_commit/delete.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ fn a_loose_ref_with_old_value_check_and_outdated_packed_refs_value_deletes_both_
414414
"only one edit even though technically two places were changed"
415415
);
416416
assert!(
417-
store.try_find("newer-as-loose",)?.is_none(),
417+
store.try_find("newer-as-loose")?.is_none(),
418418
"reference is deleted everywhere"
419419
);
420420
Ok(())

gix-ref/tests/refs/file/worktree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ mod writable {
598598
{
599599
let unprefixed_name = "refs/heads/new";
600600
let reference = store.find(unprefixed_name)?;
601-
assert_eq!(reference.target.id(), new_id_main,);
601+
assert_eq!(reference.target.id(), new_id_main);
602602
assert_eq!(
603603
reflog_for_name(&store, reference.name.as_ref(), &mut buf),
604604
vec![new_id_main.to_string()]

gix-refspec/tests/refspec/matching.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ pub mod baseline {
168168
fixes: expected_fixes,
169169
} => {
170170
let (actual, actual_fixes) = actual.unwrap();
171-
assert_eq!(&actual_fixes, expected_fixes,);
171+
assert_eq!(&actual_fixes, expected_fixes);
172172
(actual.mappings, expected)
173173
}
174174
};

gix-revision/tests/revision/describe/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ fn typical_usecases() -> crate::Result {
187187
},
188188
|res, id| {
189189
let res = res?.expect("candidate found");
190-
assert_eq!(res.name, Some(name.clone()),);
190+
assert_eq!(res.name, Some(name.clone()));
191191
assert_eq!(res.id, id);
192192
assert_eq!(res.depth, 1);
193193
assert_eq!(res.commits_seen, 2);
@@ -236,7 +236,7 @@ fn shallow_yields_result_if_refs_are_available() -> crate::Result {
236236
},
237237
|res, id| {
238238
let res = res?.expect("found candidate");
239-
assert_eq!(res.name, Some(name.clone()),);
239+
assert_eq!(res.name, Some(name.clone()));
240240
assert_eq!(res.id, id);
241241
assert_eq!(res.depth, 1);
242242
assert_eq!(res.commits_seen, 2);

gix-revision/tests/revision/spec/parse/anchor/at_symbol.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn reflog_by_entry_for_current_branch() {
2323
let rec = parse(spec);
2424

2525
assert!(rec.kind.is_none());
26-
assert_eq!(rec.find_ref[0], None,);
26+
assert_eq!(rec.find_ref[0], None);
2727
assert_eq!(
2828
rec.prefix[0], None,
2929
"neither ref nor prefixes are set, straight to navigation"
@@ -38,7 +38,7 @@ fn reflog_by_date_for_current_branch() {
3838
let rec = parse("@{1979-02-26 18:30:00}");
3939

4040
assert!(rec.kind.is_none());
41-
assert_eq!(rec.find_ref[0], None,);
41+
assert_eq!(rec.find_ref[0], None);
4242
assert_eq!(
4343
rec.prefix[0], None,
4444
"neither ref nor prefixes are set, straight to navigation"
@@ -52,7 +52,7 @@ fn reflog_by_unix_timestamp_for_current_branch() {
5252
let rec = parse("@{100000000}");
5353

5454
assert!(rec.kind.is_none());
55-
assert_eq!(rec.find_ref[0], None,);
55+
assert_eq!(rec.find_ref[0], None);
5656
assert_eq!(
5757
rec.prefix[0], None,
5858
"neither ref nor prefixes are set, straight to navigation"
@@ -104,7 +104,7 @@ fn reflog_by_date_for_given_ref_name() {
104104

105105
assert!(rec.kind.is_none());
106106
assert_eq!(rec.get_ref(0), expected_ref);
107-
assert_eq!(rec.prefix[0], None,);
107+
assert_eq!(rec.prefix[0], None);
108108
assert_eq!(rec.current_branch_reflog_entry[0], Some("42 +0030".to_string()));
109109
assert_eq!(rec.calls, 2, "first the ref, then the reflog entry");
110110
}
@@ -121,7 +121,7 @@ fn reflog_by_entry_for_given_ref_name() {
121121

122122
assert!(rec.kind.is_none());
123123
assert_eq!(rec.get_ref(0), expected_ref);
124-
assert_eq!(rec.prefix[0], None,);
124+
assert_eq!(rec.prefix[0], None);
125125
assert_eq!(rec.current_branch_reflog_entry[0], Some(expected_entry.to_string()));
126126
assert_eq!(rec.calls, 2, "first the ref, then the reflog entry");
127127
}
@@ -162,7 +162,7 @@ fn sibling_branch_for_branch_name() {
162162
let rec = parse(spec);
163163

164164
assert!(rec.kind.is_none());
165-
assert_eq!(rec.get_ref(0), ref_name,);
165+
assert_eq!(rec.get_ref(0), ref_name);
166166
assert_eq!(rec.prefix[0], None, "neither ref nor prefix are explicitly set");
167167
assert_eq!(
168168
rec.sibling_branch[0].as_deref(),
@@ -200,7 +200,7 @@ fn nth_checked_out_branch() {
200200
let rec = parse(spec);
201201

202202
assert!(rec.kind.is_none());
203-
assert_eq!(rec.find_ref[0], None,);
203+
assert_eq!(rec.find_ref[0], None);
204204
assert_eq!(
205205
rec.prefix[0], None,
206206
"neither ref nor prefixes are set, straight to navigation"

gix-revision/tests/revision/spec/parse/anchor/describe.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ fn full_format_with_dirty_suffix_is_recognized() {
8181
let rec = parse("cargo-smart-release-679-g3bee7fb-dirty");
8282
assert!(rec.kind.is_none());
8383
assert_eq!(rec.find_ref[0], None, "git does not see this as prefix, we do");
84-
assert_eq!(rec.prefix[0], Some(gix_hash::Prefix::from_hex("3bee7fb").unwrap()),);
84+
assert_eq!(rec.prefix[0], Some(gix_hash::Prefix::from_hex("3bee7fb").unwrap()));
8585
assert_eq!(rec.prefix_hint[0], anchor_hint());
8686
assert_eq!(rec.calls, 1);
8787
}
@@ -91,7 +91,7 @@ fn partial_format_with_dirty_suffix_is_recognized() {
9191
let spec = "abcdef1-dirty";
9292
let rec = parse(spec);
9393
assert!(rec.kind.is_none());
94-
assert_eq!(rec.find_ref[0], None,);
94+
assert_eq!(rec.find_ref[0], None);
9595
assert_eq!(
9696
rec.prefix[0],
9797
Some(gix_hash::Prefix::from_hex("abcdef1").unwrap()),
@@ -110,7 +110,7 @@ fn partial_format_lookalikes_are_never_considered() {
110110
let rec = parse(spec);
111111
assert!(rec.kind.is_none());
112112
assert_eq!(rec.get_ref(0), spec);
113-
assert_eq!(rec.prefix[0], None,);
113+
assert_eq!(rec.prefix[0], None);
114114
assert_eq!(rec.calls, 1, "we don't even try the prefix");
115115
}
116116

@@ -127,6 +127,6 @@ fn partial_format_with_dirty_suffix_lookalikes_are_treated_as_refs() {
127127
.unwrap();
128128
assert!(rec.kind.is_none());
129129
assert_eq!(rec.get_ref(0), spec);
130-
assert_eq!(rec.prefix[0], None,);
130+
assert_eq!(rec.prefix[0], None);
131131
assert_eq!(rec.calls, 2);
132132
}

0 commit comments

Comments
 (0)