|
@@ -272,7 +272,6 @@ impl<'i> Iterator for Input<'i> {
|
|
|
#[derive(Copy, Clone)]
|
|
#[derive(Copy, Clone)]
|
|
|
pub enum ViolationFn<'a> {
|
|
pub enum ViolationFn<'a> {
|
|
|
NewFn(&'a (dyn Fn(SyntaxViolation) + 'a)),
|
|
NewFn(&'a (dyn Fn(SyntaxViolation) + 'a)),
|
|
|
- OldFn(&'a (dyn Fn(&'static str) + 'a)),
|
|
|
|
|
NoOp
|
|
NoOp
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -281,7 +280,6 @@ impl<'a> ViolationFn<'a> {
|
|
|
pub fn call(self, v: SyntaxViolation) {
|
|
pub fn call(self, v: SyntaxViolation) {
|
|
|
match self {
|
|
match self {
|
|
|
ViolationFn::NewFn(f) => f(v),
|
|
ViolationFn::NewFn(f) => f(v),
|
|
|
- ViolationFn::OldFn(f) => f(v.description()),
|
|
|
|
|
ViolationFn::NoOp => {}
|
|
ViolationFn::NoOp => {}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -293,7 +291,6 @@ impl<'a> ViolationFn<'a> {
|
|
|
{
|
|
{
|
|
|
match self {
|
|
match self {
|
|
|
ViolationFn::NewFn(f) => if test() { f(v) },
|
|
ViolationFn::NewFn(f) => if test() { f(v) },
|
|
|
- ViolationFn::OldFn(f) => if test() { f(v.description()) },
|
|
|
|
|
ViolationFn::NoOp => {} // avoid test
|
|
ViolationFn::NoOp => {} // avoid test
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -311,7 +308,6 @@ impl<'a> fmt::Debug for ViolationFn<'a> {
|
|
|
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
|
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
|
|
match *self {
|
|
match *self {
|
|
|
ViolationFn::NewFn(_) => write!(f, "NewFn(Fn(SyntaxViolation))"),
|
|
ViolationFn::NewFn(_) => write!(f, "NewFn(Fn(SyntaxViolation))"),
|
|
|
- ViolationFn::OldFn(_) => write!(f, "OldFn(Fn(&'static str))"),
|
|
|
|
|
ViolationFn::NoOp => write!(f, "NoOp")
|
|
ViolationFn::NoOp => write!(f, "NoOp")
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|