My rustfmt is up-to-date with the gitlab ci one again

This commit is contained in:
Nick Mathewson 2021-03-01 07:42:45 -05:00
parent 66c901265d
commit b33bc268d5
2 changed files with 20 additions and 10 deletions

View File

@ -13,11 +13,7 @@ rust-latest:
- cargo test --verbose --all
- rustup component add clippy rustfmt
- cargo clippy -- -D warnings
####
# Temporarily disabled while the CI version of rustfmt doesn't agree
# with nickm's.
#
# - cargo fmt --all -- --check
- cargo fmt --all -- --check
rust-nightly:
stage: build

View File

@ -318,7 +318,7 @@ impl<'a> DiffCommand<'a> {
/// Return true if this is an Insert command.
fn is_insert(&self) -> bool {
matches!(self, DiffCommand::Insert {..})
matches!(self, DiffCommand::Insert { .. })
}
/// Extract a single command from a line iterator that yields lines
@ -674,17 +674,31 @@ mod test {
assert!(matches!(p, DeleteToEnd { low: 100 }));
let p = parse("30,40c\nHello\nWorld\n.\n")?;
assert!(matches!(p, Replace{ low: 30, high: 40, .. }));
assert!(matches!(
p,
Replace {
low: 30,
high: 40,
..
}
));
assert_eq!(p.lines(), Some(&["Hello", "World"][..]));
let p = parse("30c\nHello\nWorld\n.\n")?;
assert!(matches!(p, Replace{ low: 30, high: 30, .. }));
assert!(matches!(
p,
Replace {
low: 30,
high: 30,
..
}
));
assert_eq!(p.lines(), Some(&["Hello", "World"][..]));
let p = parse("999a\nHello\nWorld\n.\n")?;
assert!(matches!(p, Insert{ pos: 999, .. }));
assert!(matches!(p, Insert { pos: 999, .. }));
assert_eq!(p.lines(), Some(&["Hello", "World"][..]));
let p = parse("0a\nHello\nWorld\n.\n")?;
assert!(matches!(p, Insert{ pos: 0, .. }));
assert!(matches!(p, Insert { pos: 0, .. }));
assert_eq!(p.lines(), Some(&["Hello", "World"][..]));
parse_err("hello world");