Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dtolnay/prettyplease
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6ad7a982508f34a7543542b6fffef1cf07a6c133
Choose a base ref
..
head repository: dtolnay/prettyplease
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5b476dfa4c85dcfc90ce1a9e5a8c23152c243aa5
Choose a head ref
Showing with 4 additions and 2 deletions.
  1. +3 −1 src/fixup.rs
  2. +1 −1 src/precedence.rs
4 changes: 3 additions & 1 deletion src/fixup.rs
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ use syn::{
};

#[derive(Copy, Clone)]
pub(crate) struct FixupContext {
pub struct FixupContext {
previous_operator: Precedence,
next_operator: Precedence,

@@ -590,6 +590,8 @@ fn scan_right(
_ => Scan::Consume,
},
},
// false positive: https://github.com/rust-lang/rust/issues/135137
#[cfg_attr(all(test, exhaustive), allow(non_exhaustive_omitted_patterns))]
Expr::Closure(e) => {
if matches!(e.output, ReturnType::Default)
|| matches!(&*e.body, Expr::Block(body) if body.attrs.is_empty() && body.label.is_none())
2 changes: 1 addition & 1 deletion src/precedence.rs
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ use syn::{

// Reference: https://doc.rust-lang.org/reference/expressions.html#expression-precedence
#[derive(Copy, Clone, PartialEq, PartialOrd)]
pub(crate) enum Precedence {
pub enum Precedence {
// return, break, closures
Jump,
// = += -= *= /= %= &= |= ^= <<= >>=