From da2ff5712a189a339a91973481c7c0e7ab58a99a Mon Sep 17 00:00:00 2001 From: Kat Lim Ruiz Date: Mon, 31 Mar 2025 08:21:54 -0500 Subject: [PATCH] fix fmt nightly --- query-grammar/src/infallible.rs | 11 ++++------- query-grammar/src/occur.rs | 3 ++- query-grammar/src/user_input_ast.rs | 3 ++- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/query-grammar/src/infallible.rs b/query-grammar/src/infallible.rs index 5ac22f995..072aed2ed 100644 --- a/query-grammar/src/infallible.rs +++ b/query-grammar/src/infallible.rs @@ -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; pub(crate) type JResult = IResult; @@ -44,9 +45,7 @@ fn unwrap_infallible(res: Result>) -> T { /// /// It's less generic than the original to ease type resolution in the rest of the code. pub(crate) fn opt_i(mut f: F) -> impl FnMut(I) -> JResult> -where - F: nom::Parser>, -{ +where F: nom::Parser> { move |input: I| { let i = input.clone(); match f.parse(input) { @@ -106,9 +105,7 @@ where pub(crate) fn fallible, F>( mut f: F, ) -> impl FnMut(I) -> IResult -where - F: nom::Parser, -{ +where F: nom::Parser { use nom::Err; move |input: I| match f.parse(input) { Ok((input, (output, _err))) => Ok((input, output)), diff --git a/query-grammar/src/occur.rs b/query-grammar/src/occur.rs index cb0092756..8db60876b 100644 --- a/query-grammar/src/occur.rs +++ b/query-grammar/src/occur.rs @@ -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)] diff --git a/query-grammar/src/user_input_ast.rs b/query-grammar/src/user_input_ast.rs index a66b388ed..48b51f3be 100644 --- a/query-grammar/src/user_input_ast.rs +++ b/query-grammar/src/user_input_ast.rs @@ -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)]