summaryrefslogtreecommitdiffstats
path: root/third_party/rust/naga/src/block.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/naga/src/block.rs')
-rw-r--r--third_party/rust/naga/src/block.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/third_party/rust/naga/src/block.rs b/third_party/rust/naga/src/block.rs
index 0abda9da7c..2e86a928f1 100644
--- a/third_party/rust/naga/src/block.rs
+++ b/third_party/rust/naga/src/block.rs
@@ -65,6 +65,12 @@ impl Block {
self.span_info.splice(range.clone(), other.span_info);
self.body.splice(range, other.body);
}
+
+ pub fn span_into_iter(self) -> impl Iterator<Item = (Statement, Span)> {
+ let Block { body, span_info } = self;
+ body.into_iter().zip(span_info)
+ }
+
pub fn span_iter(&self) -> impl Iterator<Item = (&Statement, &Span)> {
let span_iter = self.span_info.iter();
self.body.iter().zip(span_iter)