mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Make Position::{line, column} fields private
This commit is contained in:
parent
fae1bb4458
commit
443d738f9b
5 changed files with 115 additions and 88 deletions
|
@ -514,11 +514,10 @@ fn fmt_when<'a, 'buf>(
|
|||
let patterns = &branch.patterns;
|
||||
let expr = &branch.value;
|
||||
let (first_pattern, rest) = patterns.split_first().unwrap();
|
||||
let is_multiline = match rest.last() {
|
||||
None => false,
|
||||
Some(last_pattern) => {
|
||||
first_pattern.region.start().line != last_pattern.region.end().line
|
||||
}
|
||||
let is_multiline = if rest.is_empty() {
|
||||
false
|
||||
} else {
|
||||
patterns.iter().any(|p| p.is_multiline())
|
||||
};
|
||||
|
||||
fmt_pattern(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue