From 06bd23f8338724b9baf99d82a267e561e2f16623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 13 Aug 2018 23:46:22 +0300 Subject: [PATCH] Fix compilation of iterator example --- examples/src/bin/iterator.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/src/bin/iterator.rs b/examples/src/bin/iterator.rs index 8175b560f..64dc347a4 100644 --- a/examples/src/bin/iterator.rs +++ b/examples/src/bin/iterator.rs @@ -9,9 +9,13 @@ fn example_main() { let identity = gst::ElementFactory::make("identity", None).unwrap(); let mut iter = identity.iterate_pads(); - while let Some(res) = iter.next() { - match res { - Ok(pad) => println!("Pad: {}", pad.get_name()), + loop { + match iter.next() { + Ok(Some(pad)) => println!("Pad: {}", pad.get_name()), + Ok(None) => { + println!("Done"); + break; + } Err(gst::IteratorError::Resync) => { println!("Iterator resync"); iter.resync();