···156156 .and_then(|row| row.get(pos.x as usize))
157157 }
158158159159+ /// Obtain a mutable reference to a tile in the grid
160160+ pub fn get_mut<'a>(&'a mut self, pos: Position) -> Option<&'a mut T> {
161161+ self.data
162162+ .get_mut(pos.y as usize)
163163+ .and_then(|row| row.get_mut(pos.x as usize))
164164+ }
165165+159166 /// Get a value from the grid at the given position,
160167 /// panicking if the position is out of bounds.
161168 ///
+2-2
years/2025/src/day_2.rs
···2828 .flat_map(|r| {
2929 r.into_iter().filter(|x| {
3030 let digs = num_digits(*x);
3131- (2..=digs).into_iter().filter(|n| digs % n == 0).any(|n| {
3131+ (2..=digs).filter(|n| digs.is_multiple_of(*n)).any(|n| {
3232 let mut parts = Vec::with_capacity(n);
3333 let mut current = *x;
3434 let split_at = digs / n;
···4040 parts
4141 .first()
4242 .copied()
4343- .map_or(false, |first| parts.into_iter().all(|x| x == first))
4343+ .is_some_and(|first| parts.into_iter().all(|x| x == first))
4444 })
4545 })
4646 })