(blocks: &[LocList])
| 14 | |
| 15 | impl Spacing { |
| 16 | pub fn recognize(blocks: &[LocList]) -> Spacing { |
| 17 | let mut blocks = blocks.iter(); |
| 18 | let Some(first) = blocks.next() else { |
| 19 | return Self::Other; |
| 20 | }; |
| 21 | if first.count_blank_lines_at_start() > 0 { |
| 22 | return Self::Other; |
| 23 | } |
| 24 | if blocks.all(|bloc| bloc.count_blank_lines_at_start() > 0) { |
| 25 | Self::Between |
| 26 | } else { |
| 27 | Self::Other |
| 28 | } |
| 29 | } |
| 30 | pub fn apply( |
| 31 | self, |
| 32 | blocks: &mut [LocList], |
nothing calls this directly
no test coverage detected