mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2025-12-23 02:29:57 +00:00
fix fmt nightly
This commit is contained in:
@@ -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)),
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user