Fix a couple of trivial clippy warnings

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1226>
This commit is contained in:
Sebastian Dröge 2023-05-30 10:20:00 +03:00
parent 31b06e52ea
commit dfb261ac9a
2 changed files with 4 additions and 5 deletions

View file

@ -782,8 +782,8 @@ impl State {
self.offset
);
let mut outbuf = gst::Buffer::with_size(src.len() * mem::size_of::<f64>())
.map_err(|_| gst::FlowError::Error)?;
let mut outbuf =
gst::Buffer::with_size(mem::size_of_val(src)).map_err(|_| gst::FlowError::Error)?;
{
let outbuf = outbuf.get_mut().unwrap();
let mut dst = outbuf.map_writable().map_err(|_| gst::FlowError::Error)?;

View file

@ -106,7 +106,6 @@ fn main() {
let bus = pipeline.bus().unwrap();
let terminated_count = Arc::new(AtomicU32::new(0));
let pipeline_clone = pipeline.clone();
let l_clone = l.clone();
let _bus_watch = bus
.add_watch(move |_, msg| {
@ -163,11 +162,11 @@ fn main() {
gst::info!(CAT, "Switching to Ready");
let stop = Instant::now();
pipeline_clone.set_state(gst::State::Ready).unwrap();
pipeline.set_state(gst::State::Ready).unwrap();
gst::info!(CAT, "Switching to Ready took {:.2?}", stop.elapsed());
gst::info!(CAT, "Shutting down");
let stop = Instant::now();
pipeline_clone.set_state(gst::State::Null).unwrap();
pipeline.set_state(gst::State::Null).unwrap();
gst::info!(CAT, "Shutting down took {:.2?}", stop.elapsed());
}