Closed
Description
The style guide currently says Use spaces around binary operators
, but what about when -
is used as a negation "operator"?
Should it be:
fn main() {
let x = -1;
let name = match x {
-1 => "negative one",
_ => "other",
};
}
Or:
fn main() {
let x = - 1;
let name = match x {
- 1 => "negative one",
_ => "other",
};
}
Sorry if this is trivially obvious, but I couldn't find it explicitly listed. intellij-rust
currently formats the match arm to - 1
like in the bottom example, but I didn't want to report a bug unless I could verify that the first example is indeed what the Rust style guide is preferring.