Skip to content

Commit

Permalink
Modified resrite_let to account for trailing ' ='
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebLItalien committed Jun 30, 2024
1 parent 2b9f1b6 commit 9ed2014
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1860,7 +1860,10 @@ fn rewrite_let(
// TODO(ytmimi) comments could appear between `let` and the `pat`

// 4 = "let ".len()
let pat_shape = shape.offset_left(4)?;
let mut pat_shape = shape.offset_left(4)?;
if context.config.version() == Version::Two {
pat_shape = pat_shape.sub_width(2)?;
}
let pat_str = pat.rewrite(context, pat_shape)?;
result.push_str(&pat_str);

Expand Down

0 comments on commit 9ed2014

Please sign in to comment.