chore: rust fmt
This commit is contained in:
		
							
								
								
									
										10
									
								
								src/day4.rs
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/day4.rs
									
									
									
									
									
								
							@@ -53,11 +53,17 @@ impl WordSearch {
 | 
				
			|||||||
        for x in 0..width {
 | 
					        for x in 0..width {
 | 
				
			||||||
            for y in 0..height {
 | 
					            for y in 0..height {
 | 
				
			||||||
                // check down-right
 | 
					                // check down-right
 | 
				
			||||||
                if x <= width - needle.len() && y <= height - needle.len() && (0..needle.len()).all(|i| self.get(x + i, y + i) == needle.as_bytes()[i].into()) {
 | 
					                if x <= width - needle.len()
 | 
				
			||||||
 | 
					                    && y <= height - needle.len()
 | 
				
			||||||
 | 
					                    && (0..needle.len()).all(|i| self.get(x + i, y + i) == needle.as_bytes()[i].into())
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
                    count += 1
 | 
					                    count += 1
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                // check down-left
 | 
					                // check down-left
 | 
				
			||||||
                if x >= needle.len() - 1 && y <= height - needle.len() && (0..needle.len()).all(|i| self.get(x - i, y + i) == needle.as_bytes()[i].into()) {
 | 
					                if x >= needle.len() - 1
 | 
				
			||||||
 | 
					                    && y <= height - needle.len()
 | 
				
			||||||
 | 
					                    && (0..needle.len()).all(|i| self.get(x - i, y + i) == needle.as_bytes()[i].into())
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
                    count += 1
 | 
					                    count += 1
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +1,3 @@
 | 
				
			|||||||
use aoc_runner_derive::aoc_main;
 | 
					use aoc_runner_derive::aoc_main;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
aoc_main!{ lib = aoc2024 }
 | 
					aoc_main! { lib = aoc2024 }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user