cargo fmt
This commit is contained in:
parent
f15488194c
commit
377d515d40
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Representation {
|
pub struct Representation {
|
||||||
val: String
|
val: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Representation {
|
impl Representation {
|
||||||
pub fn new(from: &str) -> Self {
|
pub fn new(from: &str) -> Self {
|
||||||
Self { val: from.to_string() }
|
Self {
|
||||||
|
val: from.to_string(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,8 @@ where
|
|||||||
F: Fn(&O) -> bool,
|
F: Fn(&O) -> bool,
|
||||||
{
|
{
|
||||||
let orig_rep = parser.representation();
|
let orig_rep = parser.representation();
|
||||||
(move |input| {
|
(
|
||||||
|
move |input| {
|
||||||
parser.parse(input).and_then(|(result, rest)| {
|
parser.parse(input).and_then(|(result, rest)| {
|
||||||
if pred_fn(&result) {
|
if pred_fn(&result) {
|
||||||
Ok((result, rest))
|
Ok((result, rest))
|
||||||
@ -58,7 +59,9 @@ where
|
|||||||
Err(rest)
|
Err(rest)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, Representation::new(&format!("{:?} if <PREDICATE>", orig_rep)))
|
},
|
||||||
|
Representation::new(&format!("{:?} if <PREDICATE>", orig_rep)),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parses a standard identifier in a programming language
|
/// Parses a standard identifier in a programming language
|
||||||
|
Loading…
Reference in New Issue
Block a user