From 42514d75062817fad36bceffeb5cd9be5a82db3c Mon Sep 17 00:00:00 2001 From: alyx Date: Mon, 20 Nov 2023 17:58:25 -0500 Subject: clippy --- 2015/rs/code/five/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '2015/rs/code/five') diff --git a/2015/rs/code/five/src/main.rs b/2015/rs/code/five/src/main.rs index eeafd42..3c4872c 100644 --- a/2015/rs/code/five/src/main.rs +++ b/2015/rs/code/five/src/main.rs @@ -1,4 +1,4 @@ -static INPUT: &'static str = include_str!("input.txt"); +static INPUT: &str = include_str!("input.txt"); fn main() { let valueified = INPUT.split('\n').filter(|s| !s.is_empty()); @@ -34,7 +34,7 @@ fn main() { let mut flag2 = false; for c in s { - if !flag1 && (lc != c || (lc == c && (llc != lc || !pushed))) && dupeslist.contains(&(lc, c)) { flag1 = true; } + if !flag1 && (!pushed || llc != lc || lc != c) && dupeslist.contains(&(lc, c)) { flag1 = true; } if !flag1 && !dupeslist.contains(&(lc, c)) { dupeslist.push((lc, c)); pushed = true; } else { pushed = false; } if c == llc { flag2 = true; } -- cgit v1.2.3-70-g09d2