Updating nom to 4.2

This commit is contained in:
Rodolphe Breard 2019-03-03 15:23:31 +01:00
parent 22c376930b
commit 866298c948
3 changed files with 6 additions and 12 deletions

View file

@ -13,7 +13,7 @@ include = ["src/**/*", "Cargo.toml", "LICENSE-*.txt"]
[dependencies]
log = {version = "0.4", features = ["std"]}
nom = "4.1"
nom = "4.2"
opensmtpd_derive = { path = "../opensmtpd-derive", version = "0.1" }
[[example]]

View file

@ -7,10 +7,7 @@
// except according to those terms.
use crate::errors::Error;
use nom::{
alt, alt_complete, call, complete, cond, do_parse, error_position, map_res, named, opt, tag,
take_until, take_while,
};
use nom::{alt_complete, call, cond, do_parse, map_res, named, opt, tag, take_until, take_while};
use std::str::FromStr;
#[derive(Clone, Debug, PartialEq)]
@ -48,8 +45,7 @@ impl FromStr for Event {
type Err = Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
let s = s
.to_lowercase()
let s = s.to_lowercase()
.replace("link", "link-")
.replace("tx", "tx-")
.replace("protocol", "protocol-")

View file

@ -89,11 +89,9 @@ impl<T: Clone + Default + 'static> SmtpIn<T> {
let mut evts = Vec::new();
for eh in self.event_handlers.iter() {
match eh.event {
MatchEvent::Evt(ref v) => {
for e in v.iter() {
evts.push(e);
}
}
MatchEvent::Evt(ref v) => for e in v.iter() {
evts.push(e);
},
MatchEvent::All => {
println!("register|report|smtp-in|*");
evts.clear();