diff --git a/src/main.rs b/src/main.rs index 7879645..9d98fcb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -103,18 +103,17 @@ async fn start_ban_server( info!("listening changes over {}", ssh_auth_log.display()); loop { let next_line = lines.next_line().await; - if let Err(err) = next_line { error!("reading next file: {}", err); continue; } - let line = next_line.unwrap(); + + let line = next_line?; if line.is_none() { continue; } let line = line.unwrap(); - if let Some(login_attempt) = LoginAttempt::capture(line.line()) { info!( "login attempt from {}@{}:{}", @@ -141,7 +140,7 @@ async fn start_ban_server( } } None => { - login_attempts.insert(login_attempt.ip.clone(), 1); + login_attempts.insert(login_attempt.ip, 1); } } }