mirror of
https://github.com/YGGverse/htcount.git
synced 2026-03-31 09:05:41 +00:00
fix ignore-host filter
This commit is contained in:
parent
4cb9e816fd
commit
976c11410f
1 changed files with 8 additions and 5 deletions
13
src/main.rs
13
src/main.rs
|
|
@ -37,19 +37,22 @@ fn main() -> anyhow::Result<()> {
|
|||
|
||||
let mut index: HashMap<String, usize> = HashMap::with_capacity(argument.capacity);
|
||||
|
||||
for line in reader.lines() {
|
||||
'l: for line in reader.lines() {
|
||||
let host = line?
|
||||
.split_whitespace()
|
||||
.next()
|
||||
.map(|s| s.into())
|
||||
.unwrap_or_default();
|
||||
|
||||
if argument.ignore_host.contains(&host) {
|
||||
if is_debug_d {
|
||||
debug::info(format!("Host `{host}` ignored by settings"))
|
||||
for h in &argument.ignore_host {
|
||||
if h == &host {
|
||||
if is_debug_d {
|
||||
debug::info(format!("Host `{h}` ignored by settings"))
|
||||
}
|
||||
continue 'l;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
index.entry(host).and_modify(|c| *c += 1).or_insert(1);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue