Skip to content

Commit 60c8389

Browse files
committed
fix a few coroutines missing
1 parent 00fb7a8 commit 60c8389

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

src/aoc2022/day18.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fn neighbors(
8383
z: usize,
8484
width: usize,
8585
) -> impl Iterator<Item = (usize, usize, usize)> {
86-
std::iter::from_coroutine(move || {
86+
std::iter::from_coroutine(#[coroutine] move || {
8787
if x > 0 {
8888
yield (x - 1, y, z);
8989
}

src/aoc2022/day19.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl State {
234234
let min_use = bp.min_use;
235235
let max_use = bp.max_use;
236236

237-
std::iter::from_coroutine(move || {
237+
std::iter::from_coroutine(#[coroutine] move || {
238238
// not buying
239239
let mut ns = self;
240240
ns.collect();

src/aoc2023/day3.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl Entry {
3636
&'a self,
3737
grid: &'b Grid<u8>,
3838
) -> impl Iterator<Item = (usize, usize)> + 'b {
39-
std::iter::from_coroutine(move || {
39+
std::iter::from_coroutine(#[coroutine] move || {
4040
let x = self.x as i32;
4141
let y = self.y as i32;
4242
let len = self.len as i32;
@@ -61,7 +61,7 @@ impl Entry {
6161

6262
#[inline]
6363
fn get_entries(input: &Grid<u8>) -> impl Iterator<Item = Entry> + '_ {
64-
std::iter::from_coroutine(move || {
64+
std::iter::from_coroutine(#[coroutine] move || {
6565
let mut current = None;
6666
for y in 0..input.height {
6767
for x in 0..input.width {

src/grid.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl<T> Grid<T> {
7373
) -> impl Iterator<Item = (Direction, usize, usize)> {
7474
let width = self.width;
7575
let height = self.height;
76-
std::iter::from_coroutine(move || {
76+
std::iter::from_coroutine(#[coroutine] move || {
7777
if x != 0 {
7878
yield (Direction::West, x - 1, y);
7979
}

src/helpers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ macro_rules! inner_run {
7676
}
7777

7878
pub struct TimingData {
79+
#[allow(dead_code)]
7980
pub parsing: Duration,
8081
pub part1: Duration,
8182
pub part2: Duration,

0 commit comments

Comments
 (0)