diff --git a/Cargo.toml b/Cargo.toml index 76c0008..ec048bd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "rustac-py" version = "0.6.0" -edition = "2021" +edition = "2024" publish = false [lib] diff --git a/src/walk.rs b/src/walk.rs index 04e0bf3..9375ab5 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -40,7 +40,7 @@ type WalkStep = (Value, Vec, VecDeque); async fn next_walk(nodes: Arc>>) -> PyResult> { let mut nodes = nodes.lock().await; - if let Some(node) = nodes.pop_front() { + match nodes.pop_front() { Some(node) => { let mut node = node.resolve().await.map_err(Error::from)?; let items = std::mem::take(&mut node.items); let mut children = Vec::with_capacity(node.children.len()); @@ -49,7 +49,7 @@ async fn next_walk(nodes: Arc>>) -> PyResult nodes.push_back(child); } Ok(Json((node.value.into(), children, items))) - } else { + } _ => { Err(PyStopAsyncIteration::new_err("done walking")) - } + }} }