Use is_none()

Clippy emits:

 warning: binary comparison to literal `Option::None`

As suggested, use `find.is_none()` instead of comparison with `None`.
This commit is contained in:
Tobin C. Harding 2022-11-04 11:47:34 +11:00
parent d192052519
commit 3966709336
1 changed files with 1 additions and 1 deletions

View File

@ -165,7 +165,7 @@ impl core::str::FromStr for OutPoint {
return Err(ParseOutPointError::TooLong);
}
let find = s.find(':');
if find == None || find != s.rfind(':') {
if find.is_none() || find != s.rfind(':') {
return Err(ParseOutPointError::Format);
}
let colon = find.unwrap();