Commit 90c85a7e authored by Hunter Goldstein's avatar Hunter Goldstein

Reformat, switch to `cargo fmt -- --check`

parent c14f6ab0
......@@ -8,6 +8,6 @@ cache: cargo
before_script:
- rustup component add rustfmt-preview
script:
- cargo fmt -- --write-mode=diff
- cargo fmt -- --check
- cargo build
- cargo test
error_on_line_overflow = false
max_width = 80
write_mode = "overwrite"
wrap_comments = true
......@@ -146,24 +146,27 @@ pub fn tokenize(input: &str) -> Result<Vec<Token>, CalcError> {
} else {
match c.check_operator() {
OperatorState::Complete => {
tokens.push(c
.operator_type()
.ok_or_else(|| InvalidOperator(c))?);
tokens.push(
c.operator_type().ok_or_else(|| InvalidOperator(c))?,
);
chars.next();
}
OperatorState::PotentiallyIncomplete => {
chars.next();
match chars.peek() {
Some(&next_char) if next_char.is_operator() => {
tokens.push([c, next_char]
.operator_type()
.ok_or_else(|| InvalidOperator(c))?);
tokens.push(
[c, next_char]
.operator_type()
.ok_or_else(|| InvalidOperator(c))?,
);
chars.next();
}
_ => {
tokens.push(c
.operator_type()
.ok_or_else(|| InvalidOperator(c))?);
tokens.push(
c.operator_type()
.ok_or_else(|| InvalidOperator(c))?,
);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment