aboutsummaryrefslogtreecommitdiff
path: root/src/ppm.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ppm.rs')
-rw-r--r--src/ppm.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ppm.rs b/src/ppm.rs
index 7e51a75..b829b64 100644
--- a/src/ppm.rs
+++ b/src/ppm.rs
@@ -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;