diff options
| author | Fuwn <[email protected]> | 2024-06-10 03:11:39 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-06-10 03:12:18 -0700 |
| commit | caacb4d5a8a9f93f12508eacd90eff7d3f049d8a (patch) | |
| tree | 0a4c7a49b9ce4302a8b4d0265e75399f496fc1e6 /src | |
| parent | d0e6709050187c0f85bc7c491d405b4fd3fa3d9c (diff) | |
| download | para-caacb4d5a8a9f93f12508eacd90eff7d3f049d8a.tar.xz para-caacb4d5a8a9f93f12508eacd90eff7d3f049d8a.zip | |
refactor: bump nightly again
I forgot that it's 2024.
It looks like generators were renamed to coroutines.
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 2 | ||||
| -rw-r--r-- | src/ppm.rs | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 60fcfbd..e7595f4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ // Copyright (C) 2022-2022 Fuwn <[email protected]> // SPDX-License-Identifier: MIT -#![feature(decl_macro, generators, generator_trait, lazy_cell)] +#![feature(decl_macro, coroutines, coroutine_trait)] #![deny( warnings, nonstandard_style, @@ -10,7 +10,7 @@ use { collections::HashMap, fs, io::{Cursor, Read}, - ops::Generator, + ops::Coroutine, sync::OnceLock, }, }; @@ -324,7 +324,8 @@ impl PPMParser { fn read_line_types( line_types: &[u8], - ) -> impl Generator<Yield = (usize, u8), Return = ()> + '_ { + ) -> impl Coroutine<Yield = (usize, u8), Return = ()> + '_ { + #[coroutine] move || { for index in 0..192 { let line_type = @@ -374,7 +375,7 @@ impl PPMParser { { let mut generator = Self::read_line_types(&line_types[layer]); - while let std::ops::GeneratorState::Yielded((line, line_type)) = + while let std::ops::CoroutineState::Yielded((line, line_type)) = std::pin::Pin::new(&mut generator).resume(()) { let mut pixel = 0; |