cargo fmt

This commit is contained in:
Greg Shuflin 2023-02-25 02:50:43 -08:00
parent f15488194c
commit 377d515d40
2 changed files with 16 additions and 13 deletions

View File

@ -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(),
}
}
}

View File

@ -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 <PREDICATE>", 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 <PREDICATE>", orig_rep)),
)
}
/// Parses a standard identifier in a programming language