Skip to content

Commit 0b3d2c0

Browse files
committed
less indentation
1 parent 7b4903b commit 0b3d2c0

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

git2-hooks/src/lib.rs

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -326,27 +326,22 @@ exit 0
326326

327327
let result = hook.run_hook(&[TEXT]).unwrap();
328328

329-
if let HookResult::RunNotSuccessful {
329+
let HookResult::RunNotSuccessful {
330330
code,
331331
stdout,
332332
stderr,
333333
hook: h,
334334
} = result
335-
{
336-
assert_eq!(code, Some(42));
337-
assert_eq!(h, hook.hook);
338-
assert_eq!(
339-
stdout.as_str().trim_ascii_end(),
340-
TEXT,
341-
"{:?} != {TEXT:?} | {:?} != {:?}",
342-
stdout.as_str().trim_ascii_end(),
343-
stdout.as_str().trim_ascii_end().as_bytes(),
344-
TEXT.as_bytes()
345-
);
346-
assert!(stderr.is_empty());
347-
} else {
348-
panic!("run_hook should've failed");
349-
}
335+
else {
336+
unreachable!("run_hook should've failed");
337+
};
338+
339+
let stdout = stdout.as_str().trim_ascii_end();
340+
341+
assert_eq!(code, Some(42));
342+
assert_eq!(h, hook.hook);
343+
assert_eq!(stdout, TEXT, "{:?} != {TEXT:?}", stdout);
344+
assert!(stderr.is_empty());
350345
}
351346

352347
#[test]

0 commit comments

Comments
 (0)