Commit 9a059583 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵
Browse files

Run everything through rustfmt

parent d7d965c4
......@@ -29,9 +29,7 @@ struct MissingElement(&'static str);
#[derive(Debug, Fail)]
#[fail(
display = "Received error from {}: {} (debug: {:?})",
src,
error,
debug
src, error, debug
)]
struct ErrorMessage {
src: String,
......
......@@ -23,9 +23,7 @@ struct MissingElement(&'static str);
#[derive(Debug, Fail)]
#[fail(
display = "Received error from {}: {} (debug: {:?})",
src,
error,
debug
src, error, debug
)]
struct ErrorMessage {
src: String,
......
......@@ -25,9 +25,7 @@ struct MissingElement(&'static str);
#[derive(Debug, Fail)]
#[fail(
display = "Received error from {}: {} (debug: {:?})",
src,
error,
debug
src, error, debug
)]
struct ErrorMessage {
src: String,
......@@ -189,7 +187,8 @@ fn example_main() -> Result<(), Error> {
error: err.get_error().description().into(),
debug: err.get_debug(),
cause: err.get_error(),
}.into()),
}
.into()),
}?;
}
#[cfg(not(feature = "v1_10"))]
......
......@@ -16,7 +16,8 @@ fn example_main() {
let pipeline = gst::parse_launch(&format!(
"audiotestsrc name=src ! audio/x-raw,format={},channels=1 ! fakesink",
gst_audio::AUDIO_FORMAT_S16.to_string()
)).unwrap();
))
.unwrap();
let pipeline = pipeline.dynamic_cast::<gst::Pipeline>().unwrap();
let src = pipeline.get_by_name("src").unwrap();
......
......@@ -29,9 +29,7 @@ struct MissingElement(&'static str);
#[derive(Debug, Fail)]
#[fail(
display = "Received error from {}: {} (debug: {:?})",
src,
error,
debug
src, error, debug
)]
struct ErrorMessage {
src: String,
......@@ -146,7 +144,8 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> {
}
None
}).unwrap();
})
.unwrap();
let drawer_clone = drawer.clone();
overlay
......@@ -159,7 +158,8 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> {
drawer.info = Some(gst_video::VideoInfo::from_caps(&caps).unwrap());
None
}).unwrap();
})
.unwrap();
Ok(pipeline)
}
......
......@@ -39,8 +39,9 @@ fn example_main() {
} else {
None
}
}.and_then(|pos| pos.try_into_time().ok())
.unwrap();
}
.and_then(|pos| pos.try_into_time().ok())
.unwrap();
let dur = {
let mut q = gst::Query::new_duration(gst::Format::Time);
......@@ -49,8 +50,9 @@ fn example_main() {
} else {
None
}
}.and_then(|dur| dur.try_into_time().ok())
.unwrap();
}
.and_then(|dur| dur.try_into_time().ok())
.unwrap();
println!("{} / {}", pos, dur);
......
......@@ -35,9 +35,7 @@ struct UsageError(String);
#[derive(Debug, Fail)]
#[fail(
display = "Received error from {}: {} (debug: {:?})",
src,
error,
debug
src, error, debug
)]
struct ErrorMessage {
src: String,
......@@ -172,7 +170,8 @@ fn example_main() -> Result<(), Error> {
("clock-rate", &90000i32),
("is-fec", &true),
],
).to_value(),
)
.to_value(),
),
96 => Some(
gst::Caps::new_simple(
......@@ -182,7 +181,8 @@ fn example_main() -> Result<(), Error> {
("clock-rate", &90000i32),
("encoding-name", &"VP8"),
],
).to_value(),
)
.to_value(),
),
_ => None,
}
......@@ -266,17 +266,20 @@ fn example_main() -> Result<(), Error> {
error: err.get_error().description().into(),
debug: err.get_debug(),
cause: err.get_error(),
}.into());
}
.into());
}
MessageView::StateChanged(s) => match msg.get_src() {
Some(element) => if element == pipeline && s.get_current() == gst::State::Playing {
eprintln!("PLAYING");
gst::debug_bin_to_dot_file(
&pipeline,
gst::DebugGraphDetails::all(),
"client-playing",
);
},
Some(element) => {
if element == pipeline && s.get_current() == gst::State::Playing {
eprintln!("PLAYING");
gst::debug_bin_to_dot_file(
&pipeline,
gst::DebugGraphDetails::all(),
"client-playing",
);
}
}
None => (),
},
_ => (),
......
......@@ -32,9 +32,7 @@ struct UsageError(String);
#[derive(Debug, Fail)]
#[fail(
display = "Received error from {}: {} (debug: {:?})",
src,
error,
debug
src, error, debug
)]
struct ErrorMessage {
src: String,
......@@ -199,17 +197,20 @@ fn example_main() -> Result<(), Error> {
error: err.get_error().description().into(),
debug: err.get_debug(),
cause: err.get_error(),
}.into());
}
.into());
}
MessageView::StateChanged(s) => match msg.get_src() {
Some(element) => if element == pipeline && s.get_current() == gst::State::Playing {
eprintln!("PLAYING");
gst::debug_bin_to_dot_file(
&pipeline,
gst::DebugGraphDetails::all(),
"server-playing",
);
},
Some(element) => {
if element == pipeline && s.get_current() == gst::State::Playing {
eprintln!("PLAYING");
gst::debug_bin_to_dot_file(
&pipeline,
gst::DebugGraphDetails::all(),
"server-playing",
);
}
}
None => (),
},
_ => (),
......
......@@ -21,9 +21,7 @@ struct MissingElement(String);
#[derive(Debug, Fail)]
#[fail(
display = "Received error from {}: {} (debug: {:?})",
src,
error,
debug
src, error, debug
)]
struct ErrorMessage {
src: String,
......
......@@ -31,7 +31,8 @@ impl NetClientClock {
remote_address.to_glib_none().0,
remote_port,
base_time.to_glib(),
)).downcast_unchecked()
))
.downcast_unchecked()
}
} else {
// Workaround for bad floating reference handling in 1.12. This issue was fixed for 1.13
......@@ -41,7 +42,8 @@ impl NetClientClock {
remote_address.to_glib_none().0,
remote_port,
base_time.to_glib(),
)).downcast_unchecked()
))
.downcast_unchecked()
}
}
}
......
......@@ -31,7 +31,8 @@ impl NtpClock {
remote_address.to_glib_none().0,
remote_port,
base_time.to_glib(),
)).downcast_unchecked()
))
.downcast_unchecked()
}
} else {
// Workaround for bad floating reference handling in 1.12. This issue was fixed for 1.13
......@@ -41,7 +42,8 @@ impl NtpClock {
remote_address.to_glib_none().0,
remote_port,
base_time.to_glib(),
)).downcast_unchecked()
))
.downcast_unchecked()
}
}
}
......
......@@ -31,7 +31,8 @@ impl PtpClock {
remote_address.to_glib_none().0,
remote_port,
base_time.to_glib(),
)).downcast_unchecked()
))
.downcast_unchecked()
}
} else {
// Workaround for bad floating reference handling in 1.12. This issue was fixed for 1.13
......@@ -41,7 +42,8 @@ impl PtpClock {
remote_address.to_glib_none().0,
remote_port,
base_time.to_glib(),
)).downcast_unchecked()
))
.downcast_unchecked()
}
}
}
......
......@@ -117,7 +117,8 @@ mod tests {
" ),",
" buffer: \"AQIDBA==\",",
")"
).to_owned()),
)
.to_owned()),
res
);
......@@ -133,7 +134,8 @@ mod tests {
"\"flags\":{\"bits\":1048592},",
"\"buffer\":[1,2,3,4]",
"}"
).to_owned(),
)
.to_owned(),
res
);
......
......@@ -131,7 +131,8 @@ mod tests {
" buffer: \"BQY=\",",
" ),",
"]"
).to_owned()),
)
.to_owned()),
res,
);
}
......
......@@ -439,7 +439,8 @@ mod tests {
("fraction", &Fraction::new(1, 2)),
("array", &Array::new(&[&1, &2])),
],
).as_ref()
)
.as_ref()
);
}
......
......@@ -270,7 +270,8 @@ mod tests {
" ]),",
" ]), None),",
"])"
).to_owned()),
)
.to_owned()),
res,
);
......@@ -326,7 +327,8 @@ mod tests {
("fraction", &Fraction::new(1, 2)),
("array", &Array::new(&[&1, &2])),
],
).as_ref()
)
.as_ref()
);
}
......
......@@ -43,7 +43,8 @@ unsafe extern "C" fn trampoline_wait_async(
&from_glib_borrow(clock),
from_glib(time),
&from_glib_borrow(id),
).to_glib()
)
.to_glib()
}
unsafe extern "C" fn destroy_closure_wait_async(ptr: gpointer) {
......
......@@ -40,7 +40,8 @@ impl GhostPad {
name.0,
target.to_glib_none().0,
templ.to_glib_none().0,
)).map(|o| Downcast::downcast_unchecked(o))
))
.map(|o| Downcast::downcast_unchecked(o))
}
}
......
......@@ -384,7 +384,8 @@ unsafe extern "C" fn filter_boxed_get_type<T: StaticType + 'static>() -> glib_ff
"GstRsIteratorFilterBoxed-{}-{}",
T::static_type().name(),
idx
)).unwrap();
))
.unwrap();
if gobject_ffi::g_type_from_name(type_name.as_ptr()) == gobject_ffi::G_TYPE_INVALID
{
break type_name;
......
......@@ -60,7 +60,8 @@ impl<O: IsA<::Object> + IsA<glib::Object> + glib::value::SetValue> GstObjectExtM
f(&obj, &prop_obj, &pspec);
None
}).unwrap()
})
.unwrap()
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment