clippy: fix lints

This commit is contained in:
Antoine Martin 2021-11-25 16:23:22 +01:00
parent e01307eb3c
commit e82df94852
7 changed files with 16 additions and 16 deletions

View file

@ -31,11 +31,11 @@ impl FromStr for Event {
type Err = anyhow::Error;
fn from_str(s: &str) -> Result<Self> {
if s.find("wakes up").is_some() {
if s.contains("wakes up") {
Ok(Event::WakeUp)
} else if s.find("falls asleep").is_some() {
} else if s.contains("falls asleep") {
Ok(Event::FallAsleep)
} else if s.find("begins shift").is_some() {
} else if s.contains("begins shift") {
let pound = s.find('#').context("`#` not found")?;
let s = &s[(pound + 1)..];
let space = s.find(' ').context("` ` not found after `#`")?;