tidy: is_whitespace() already covers newline, remove redundant arm
This commit is contained in:
parent
254fd1f9f1
commit
e20a311786
1 changed files with 1 additions and 1 deletions
|
|
@ -390,7 +390,7 @@ fn extract_new_password(bot_message: &str) -> Option<String> {
|
||||||
let rest = rest.trim_start();
|
let rest = rest.trim_start();
|
||||||
// Stop at first whitespace or newline; password must be non-empty.
|
// Stop at first whitespace or newline; password must be non-empty.
|
||||||
let end = rest
|
let end = rest
|
||||||
.find(|c: char| c.is_whitespace() || c == '\n')
|
.find(char::is_whitespace)
|
||||||
.unwrap_or(rest.len());
|
.unwrap_or(rest.len());
|
||||||
let pw = rest[..end].trim();
|
let pw = rest[..end].trim();
|
||||||
if !pw.is_empty() {
|
if !pw.is_empty() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue