Skip to content

Commit

Permalink
Return a message if no proxies were found
Browse files Browse the repository at this point in the history
  • Loading branch information
zolagonano committed May 1, 2024
1 parent 4c0b127 commit a28f455
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,20 @@ impl Command {
_ => (),
};

match self {
let result = match self {
Command::Help => HELP_MESSAGE.to_string(),
_ => proxy_list
.into_iter()
.take(8)
.collect::<Vec<_>>()
.join("\n﹌﹌﹌\n"),
};

if result.is_empty() {
return "No proxies were found! ".to_string();
}

result
}
}

Expand Down

0 comments on commit a28f455

Please sign in to comment.