mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-29 13:01:05 +00:00
Use while let
When destructuring a single pattern in a loop it is nicer to use while let. Fixes https://github.com/sdroege/gstreamer-rs/pull/46 Fixes https://github.com/sdroege/gstreamer-rs/issues/45
This commit is contained in:
parent
342d89dd44
commit
95dc336b65
1 changed files with 28 additions and 35 deletions
|
@ -119,11 +119,7 @@ fn main() {
|
||||||
// Wait until error, EOS or State Change
|
// Wait until error, EOS or State Change
|
||||||
let bus = pipeline.get_bus().unwrap();
|
let bus = pipeline.get_bus().unwrap();
|
||||||
|
|
||||||
loop {
|
while let Some(msg) = bus.timed_pop(gst::CLOCK_TIME_NONE) {
|
||||||
let msg = bus.timed_pop(gst::CLOCK_TIME_NONE);
|
|
||||||
|
|
||||||
match msg {
|
|
||||||
Some(msg) => {
|
|
||||||
match msg.view() {
|
match msg.view() {
|
||||||
MessageView::Error(err) => {
|
MessageView::Error(err) => {
|
||||||
println!(
|
println!(
|
||||||
|
@ -154,9 +150,6 @@ fn main() {
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None => (),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Shutdown pipeline
|
// Shutdown pipeline
|
||||||
let ret = pipeline.set_state(gst::State::Null);
|
let ret = pipeline.set_state(gst::State::Null);
|
||||||
|
|
Loading…
Reference in a new issue