diff --git a/opensmtpd/Cargo.toml b/opensmtpd/Cargo.toml index 2e14637..ad58d92 100644 --- a/opensmtpd/Cargo.toml +++ b/opensmtpd/Cargo.toml @@ -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]] diff --git a/opensmtpd/src/entry.rs b/opensmtpd/src/entry.rs index c4e0372..954d1a6 100644 --- a/opensmtpd/src/entry.rs +++ b/opensmtpd/src/entry.rs @@ -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 { - let s = s - .to_lowercase() + let s = s.to_lowercase() .replace("link", "link-") .replace("tx", "tx-") .replace("protocol", "protocol-") diff --git a/opensmtpd/src/lib.rs b/opensmtpd/src/lib.rs index 9588439..4d307e3 100644 --- a/opensmtpd/src/lib.rs +++ b/opensmtpd/src/lib.rs @@ -89,11 +89,9 @@ impl SmtpIn { 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();