Run everything through rustfmt

This commit is contained in:
Sebastian Dröge 2018-11-03 20:28:58 +02:00
parent fb0178a4f2
commit 352f1c80d4
4 changed files with 37 additions and 15 deletions

View file

@ -1,8 +1,9 @@
ignore = [ ignore = [
"gstreamer/src/auto/", "gstreamer/src/auto",
"gstreamer-app/src/auto", "gstreamer-app/src/auto",
"gstreamer-audio/src/auto", "gstreamer-audio/src/auto",
"gstreamer-base/src/auto", "gstreamer-base/src/auto",
"gstreamer-check/src/auto",
"gstreamer-net/src/auto", "gstreamer-net/src/auto",
"gstreamer-pbutils/src/auto", "gstreamer-pbutils/src/auto",
"gstreamer-player/src/auto", "gstreamer-player/src/auto",

View file

@ -16,8 +16,8 @@ use gst::prelude::*;
use std::marker::PhantomData; use std::marker::PhantomData;
use std::mem; use std::mem;
use std::ops; use std::ops;
use std::ptr;
use std::path; use std::path;
use std::ptr;
use TestClock; use TestClock;
#[derive(Debug)] #[derive(Debug)]

View file

@ -14,13 +14,21 @@ use TestClock;
impl TestClock { impl TestClock {
pub fn has_id(&self, id: &gst::ClockId) -> bool { pub fn has_id(&self, id: &gst::ClockId) -> bool {
unsafe { from_glib(ffi::gst_test_clock_has_id(self.to_glib_none().0, id.to_glib_none().0)) } unsafe {
from_glib(ffi::gst_test_clock_has_id(
self.to_glib_none().0,
id.to_glib_none().0,
))
}
} }
pub fn peek_next_pending_id(&self) -> Option<gst::ClockId> { pub fn peek_next_pending_id(&self) -> Option<gst::ClockId> {
unsafe { unsafe {
let mut id = ptr::null_mut(); let mut id = ptr::null_mut();
let ret: bool = from_glib(ffi::gst_test_clock_peek_next_pending_id(self.to_glib_none().0, &mut id)); let ret: bool = from_glib(ffi::gst_test_clock_peek_next_pending_id(
self.to_glib_none().0,
&mut id,
));
if ret { if ret {
from_glib_full(id) from_glib_full(id)
} else { } else {
@ -31,20 +39,29 @@ impl TestClock {
pub fn process_id_list(&self, pending_list: &[&gst::ClockId]) -> u32 { pub fn process_id_list(&self, pending_list: &[&gst::ClockId]) -> u32 {
unsafe { unsafe {
ffi::gst_test_clock_process_id_list(self.to_glib_none().0, pending_list.to_glib_none().0) ffi::gst_test_clock_process_id_list(
self.to_glib_none().0,
pending_list.to_glib_none().0,
)
} }
} }
pub fn process_next_clock_id(&self) -> Option<gst::ClockId> { pub fn process_next_clock_id(&self) -> Option<gst::ClockId> {
unsafe { unsafe {
from_glib_full(ffi::gst_test_clock_process_next_clock_id(self.to_glib_none().0)) from_glib_full(ffi::gst_test_clock_process_next_clock_id(
self.to_glib_none().0,
))
} }
} }
pub fn wait_for_multiple_pending_ids(&self, count: u32) -> Vec<gst::ClockId> { pub fn wait_for_multiple_pending_ids(&self, count: u32) -> Vec<gst::ClockId> {
unsafe { unsafe {
let mut pending_list = ptr::null_mut(); let mut pending_list = ptr::null_mut();
ffi::gst_test_clock_wait_for_multiple_pending_ids(self.to_glib_none().0, count, &mut pending_list); ffi::gst_test_clock_wait_for_multiple_pending_ids(
self.to_glib_none().0,
count,
&mut pending_list,
);
FromGlibPtrContainer::from_glib_full(pending_list) FromGlibPtrContainer::from_glib_full(pending_list)
} }
} }

View file

@ -90,16 +90,20 @@ fn on_connect_discovered(
match discoverer_info.get_result() { match discoverer_info.get_result() {
DiscovererResult::Ok => println!("Discovered {}", uri), DiscovererResult::Ok => println!("Discovered {}", uri),
DiscovererResult::UriInvalid => println!("Invalid uri {}", uri), DiscovererResult::UriInvalid => println!("Invalid uri {}", uri),
DiscovererResult::Error => if let Some(msg) = error { DiscovererResult::Error => {
println!("{}", msg); if let Some(msg) = error {
} else { println!("{}", msg);
println!("Unknown error") } else {
}, println!("Unknown error")
}
}
DiscovererResult::Timeout => println!("Timeout"), DiscovererResult::Timeout => println!("Timeout"),
DiscovererResult::Busy => println!("Busy"), DiscovererResult::Busy => println!("Busy"),
DiscovererResult::MissingPlugins => if let Some(s) = discoverer_info.get_misc() { DiscovererResult::MissingPlugins => {
println!("{}", s); if let Some(s) = discoverer_info.get_misc() {
}, println!("{}", s);
}
}
_ => println!("Unknown result"), _ => println!("Unknown result"),
} }