Trying to do advent of code in Rust. I am very new to rust so please help if you see me doing something stupid!!

Create circuit.rs

Signed-off-by: Business Goose <did:plc:hsqwcidfez66lwm3gxhfv5in>

+23
+23
day8/src/circuit.rs
··· 1 + use crate::Point; 2 + use std::fmt::Debug; 3 + 4 + #[derive(Clone, Hash, PartialEq, Eq)] 5 + pub struct Circuit { 6 + nodes: Vec<Point>, 7 + size: usize, 8 + } 9 + 10 + impl Circuit { 11 + pub fn contains_point(&self, point: &Point) -> bool { 12 + self.nodes.contains(point) 13 + } 14 + } 15 + impl Debug for Circuit { 16 + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 17 + writeln!(f, "Circuit {{ "); 18 + for node in &self.nodes { 19 + writeln!(f, "{:?}, ", node)?; 20 + } 21 + writeln!(f, "size: {} }} ", self.size) 22 + } 23 + }