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