summaryrefslogtreecommitdiffstats
path: root/2015/rs/code/five
diff options
context:
space:
mode:
authoralyx <alyx@aleteoryx.me>2023-11-20 17:58:25 -0500
committeralyx <alyx@aleteoryx.me>2023-11-20 17:58:25 -0500
commit42514d75062817fad36bceffeb5cd9be5a82db3c (patch)
treec56ecede46a8f082edd504a28847f0737c2cf276 /2015/rs/code/five
parentb17f7207359cb2059dd7277f9ec816921147c485 (diff)
downloadadventofcode-42514d75062817fad36bceffeb5cd9be5a82db3c.tar.gz
adventofcode-42514d75062817fad36bceffeb5cd9be5a82db3c.tar.bz2
adventofcode-42514d75062817fad36bceffeb5cd9be5a82db3c.zip
clippy
Diffstat (limited to '2015/rs/code/five')
-rw-r--r--2015/rs/code/five/src/main.rs4
1 files changed, 2 insertions, 2 deletions
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; }