style
This commit is contained in:
parent
23733caed8
commit
42c318a1b8
1 changed files with 14 additions and 13 deletions
27
src/main.rs
27
src/main.rs
|
@ -112,19 +112,20 @@ async fn handle_peer(
|
||||||
let ip = peer.ip();
|
let ip = peer.ip();
|
||||||
|
|
||||||
let mut lines = FramedRead::new(stream, LinesCodec::new());
|
let mut lines = FramedRead::new(stream, LinesCodec::new());
|
||||||
loop {
|
while let Some(line) = lines.next().await.transpose()? {
|
||||||
match lines.next().await.transpose()? {
|
let ParsedLine {
|
||||||
Some(line) => {
|
prio,
|
||||||
let (prio, now, date, service, log) = parse_line(&line)?;
|
rcvtime,
|
||||||
if !blacklist.contains(service) {
|
logtime,
|
||||||
db.execute(
|
service,
|
||||||
&insert_statement,
|
entry,
|
||||||
&[&prio, &ip, &now, &date, &service, &log],
|
} = parse_line(&line)?;
|
||||||
)
|
if !blacklist.contains(service) {
|
||||||
.await?;
|
db.execute(
|
||||||
}
|
&insert_statement,
|
||||||
}
|
&[&prio, &ip, &rcvtime, &logtime, &service, &entry],
|
||||||
None => break,
|
)
|
||||||
|
.await?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Reference in a new issue