Skip to content

Commit b2835cc

Browse files
committed
refactor
1 parent f5959ed commit b2835cc

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:2b034a569959fd83c39e7aa870fea63b5fd8b87b5665e65881fade92592fc2c3
2+
oid sha256:5acb6a5de229b312880af9847cefa54ccb8385f4273f0bb365f2af66dd789f0f
33
size 11040

git-index/tests/fixtures/make_index/v2_all_file_kinds.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ set -eu -o pipefail
44
export GIT_INDEX_VERSION=2;
55

66
git init -q sub
7-
cd sub
7+
(cd sub
88

9-
touch a b c
10-
git add .
11-
git commit -m "empty"
12-
13-
cd ..
9+
touch a b c
10+
git add .
11+
git commit -m "init"
12+
)
1413

1514
git init -q
1615
git config index.threads 1
@@ -22,4 +21,4 @@ mkdir d
2221
(cd d && touch a b c)
2322

2423
git add .
25-
git commit -m "empty"
24+
git commit -m "init"

git-index/tests/index/init.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ fn compare_states(actual: &State, expected: &State, fixture: &str) {
3838
fixture
3939
);
4040

41-
actual.entries().iter().zip(expected.entries()).for_each(|(a, e)| {
41+
for (a, e) in actual.entries().iter().zip(expected.entries()) {
4242
assert_eq!(a.id, e.id, "entry id mismatch in {:?}", fixture);
4343
assert_eq!(a.flags, e.flags, "entry flags mismatch in {:?}", fixture);
4444
assert_eq!(a.mode, e.mode, "entry mode mismatch in {:?}", fixture);
4545
assert_eq!(a.path(actual), e.path(expected), "entry path mismatch in {:?}", fixture);
46-
})
46+
}
4747
}

git-pathspec/tests/pathspec.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ mod parse {
284284
":_()", ":`()", ":~()",
285285
];
286286

287-
inputs.into_iter().for_each(|input| {
287+
for input in inputs.into_iter() {
288288
assert!(
289289
!check_against_baseline(input),
290290
"This pathspec is valid in git: {}",
@@ -294,7 +294,7 @@ mod parse {
294294
let output = git_pathspec::parse(input.as_bytes());
295295
assert!(output.is_err());
296296
assert!(matches!(output.unwrap_err(), Error::Unimplemented { .. }));
297-
});
297+
}
298298
}
299299

300300
#[test]
@@ -306,7 +306,7 @@ mod parse {
306306
":(top,exclude,icse)some/path",
307307
];
308308

309-
inputs.into_iter().for_each(|input| {
309+
for input in inputs.into_iter() {
310310
assert!(
311311
!check_against_baseline(input),
312312
"This pathspec is valid in git: {}",
@@ -316,7 +316,7 @@ mod parse {
316316
let output = git_pathspec::parse(input.as_bytes());
317317
assert!(output.is_err());
318318
assert!(matches!(output.unwrap_err(), Error::InvalidKeyword { .. }));
319-
});
319+
}
320320
}
321321

322322
#[test]
@@ -454,7 +454,7 @@ mod parse {
454454
}
455455

456456
fn check_valid_inputs<'a>(inputs: impl IntoIterator<Item = (&'a str, PatternForTesting)>) {
457-
inputs.into_iter().for_each(|(input, expected)| {
457+
for (input, expected) in inputs.into_iter() {
458458
assert!(
459459
check_against_baseline(input),
460460
"This pathspec is invalid in git: {}",
@@ -465,7 +465,7 @@ mod parse {
465465
.unwrap_or_else(|_| panic!("parsing should not fail with pathspec {}", input))
466466
.into();
467467
assert_eq!(pattern, expected, "while checking input: \"{}\"", input);
468-
});
468+
}
469469
}
470470

471471
fn pat_with_path(path: &str) -> PatternForTesting {

0 commit comments

Comments
 (0)