From 25be019d725a1114eedaca9ae665eb46a595af60 Mon Sep 17 00:00:00 2001
From: Fabian Schmidt <fabschmidt96@gmail.com>
Date: Tue, 29 Oct 2024 09:29:15 +0100
Subject: [PATCH] y2015d6p1 forgot to negate NOT value on return

---
 y2015/src/days/d7.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/y2015/src/days/d7.rs b/y2015/src/days/d7.rs
index fe8cb1b..9ebaca6 100644
--- a/y2015/src/days/d7.rs
+++ b/y2015/src/days/d7.rs
@@ -9,7 +9,7 @@ pub fn process_part1(input: &str) -> HashMap<String, u16> {
         instructions.insert(wire.to_string(), expression.to_string());
     }
     for wire in instructions.keys() {
-        set_wire(wire.to_owned(), &mut wires, &instructions);
+        set_wire(wire.to_string(), &mut wires, &instructions);
     }
     wires
 }
@@ -39,7 +39,7 @@ fn set_wire(
     if parts.len() == 2 {
         let value = set_wire(parts[1].clone(), wires, instructions);
         wires.insert(wire, !value);
-        return value;
+        return !value;
     }
     if parts.len() == 3 {
         let left = match parts[0].parse::<u16>() {