fix fmt nightly

This commit is contained in:
Kat Lim Ruiz
2025-03-31 08:21:54 -05:00
parent 18da402e27
commit da2ff5712a
3 changed files with 8 additions and 9 deletions

View File

@@ -1,8 +1,9 @@
//! nom combinators for infallible operations
use std::convert::Infallible;
use nom::{AsChar, IResult, InputLength, InputTakeAtPosition};
use serde::Serialize;
use std::convert::Infallible;
pub(crate) type ErrorList = Vec<LenientErrorInternal>;
pub(crate) type JResult<I, O> = IResult<I, (O, ErrorList), Infallible>;
@@ -44,9 +45,7 @@ fn unwrap_infallible<T>(res: Result<T, nom::Err<Infallible>>) -> T {
///
/// It's less generic than the original to ease type resolution in the rest of the code.
pub(crate) fn opt_i<I: Clone, O, F>(mut f: F) -> impl FnMut(I) -> JResult<I, Option<O>>
where
F: nom::Parser<I, O, nom::error::Error<I>>,
{
where F: nom::Parser<I, O, nom::error::Error<I>> {
move |input: I| {
let i = input.clone();
match f.parse(input) {
@@ -106,9 +105,7 @@ where
pub(crate) fn fallible<I, O, E: nom::error::ParseError<I>, F>(
mut f: F,
) -> impl FnMut(I) -> IResult<I, O, E>
where
F: nom::Parser<I, (O, ErrorList), Infallible>,
{
where F: nom::Parser<I, (O, ErrorList), Infallible> {
use nom::Err;
move |input: I| match f.parse(input) {
Ok((input, (output, _err))) => Ok((input, output)),

View File

@@ -1,7 +1,8 @@
use serde::Serialize;
use std::fmt;
use std::fmt::Write;
use serde::Serialize;
/// Defines whether a term in a query must be present,
/// should be present or must not be present.
#[derive(Debug, Clone, Hash, Copy, Eq, PartialEq, Serialize)]

View File

@@ -1,7 +1,8 @@
use serde::Serialize;
use std::fmt;
use std::fmt::{Debug, Formatter};
use serde::Serialize;
use crate::Occur;
#[derive(PartialEq, Clone, Serialize)]