From 377d515d40794886c038028b945895c70e410411 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Sat, 25 Feb 2023 02:50:43 -0800 Subject: [PATCH] cargo fmt --- src/parser/representation.rs | 8 ++++---- src/primitives/mod.rs | 21 ++++++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/parser/representation.rs b/src/parser/representation.rs index 7f0e10d..5b7c0c4 100644 --- a/src/parser/representation.rs +++ b/src/parser/representation.rs @@ -1,12 +1,12 @@ - - #[derive(Debug, Clone)] pub struct Representation { - val: String + val: String, } impl Representation { pub fn new(from: &str) -> Self { - Self { val: from.to_string() } + Self { + val: from.to_string(), + } } } diff --git a/src/primitives/mod.rs b/src/primitives/mod.rs index f8ed2fc..047fd1d 100644 --- a/src/primitives/mod.rs +++ b/src/primitives/mod.rs @@ -50,15 +50,18 @@ where F: Fn(&O) -> bool, { let orig_rep = parser.representation(); - (move |input| { - parser.parse(input).and_then(|(result, rest)| { - if pred_fn(&result) { - Ok((result, rest)) - } else { - Err(rest) - } - }) - }, Representation::new(&format!("{:?} if ", orig_rep))) + ( + move |input| { + parser.parse(input).and_then(|(result, rest)| { + if pred_fn(&result) { + Ok((result, rest)) + } else { + Err(rest) + } + }) + }, + Representation::new(&format!("{:?} if ", orig_rep)), + ) } /// Parses a standard identifier in a programming language