Remove unnecessary arg to check_indent

Quick refactoring / follow-up to #6634
This commit is contained in:
Joshua Warner 2024-04-18 14:51:19 -10:00
parent 6059f7afcb
commit 50d2111919
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
2 changed files with 16 additions and 10 deletions

View file

@ -197,17 +197,12 @@ where
)
}
pub fn check_indent<'a, E>(
indent_problem: fn(Position) -> E,
inside_suffixed_statement: bool,
) -> impl Parser<'a, (), E>
pub fn check_indent<'a, E>(indent_problem: fn(Position) -> E) -> impl Parser<'a, (), E>
where
E: 'a,
{
let extra_spaces = if inside_suffixed_statement { 1 } else { 0 };
move |_, state: State<'a>, min_indent: u32| {
if state.column() >= (min_indent + extra_spaces) {
if state.column() >= min_indent {
Ok((NoProgress, (), state))
} else {
Err((NoProgress, indent_problem(state.pos())))