mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-09-01 09:23:50 +00:00
Fix various new 1.88 clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1744>
This commit is contained in:
parent
58b2cf6b3e
commit
cfe67b5d3f
9 changed files with 25 additions and 26 deletions
|
@ -39,7 +39,7 @@ fn print_stream_info(stream: &DiscovererStreamInfo) {
|
|||
println!("Stream: ");
|
||||
|
||||
if let Some(stream_id) = stream.stream_id() {
|
||||
println!(" Stream id: {}", stream_id);
|
||||
println!(" Stream id: {stream_id}");
|
||||
}
|
||||
|
||||
let caps_str = match stream.caps() {
|
||||
|
|
|
@ -389,7 +389,7 @@ impl App {
|
|||
let gl_display = gl_config.display();
|
||||
let raw_gl_display = gl_display.raw_display();
|
||||
|
||||
println!("Using raw display connection {:?}", raw_gl_display);
|
||||
println!("Using raw display connection {raw_gl_display:?}");
|
||||
|
||||
let window_handle = window
|
||||
.as_ref()
|
||||
|
@ -430,7 +430,7 @@ impl App {
|
|||
|
||||
let raw_gl_context = not_current_gl_context.raw_context();
|
||||
|
||||
println!("Using raw GL context {:?}", raw_gl_context);
|
||||
println!("Using raw GL context {raw_gl_context:?}");
|
||||
|
||||
#[cfg(not(any(target_os = "linux", windows)))]
|
||||
compile_error!("This example only has Linux and Windows support");
|
||||
|
|
|
@ -28,6 +28,6 @@ impl TensorDataType {
|
|||
impl std::fmt::Display for TensorDataType {
|
||||
#[inline]
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
f.write_str(&self.name())
|
||||
f.write_str(self.name())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ impl TensorMeta {
|
|||
// FIXME: This is not ideal but otherwise we can't return a reference safely
|
||||
self.as_slice()
|
||||
.iter()
|
||||
.find(|t| t.as_ptr() == res as *mut ffi::GstTensor)
|
||||
.find(|t| std::ptr::eq(t.as_ptr(), res))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -235,7 +235,7 @@ impl GLVideoFrame<Writable> {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn memory_mut(&self, idx: u32) -> Result<&mut GLMemoryRef, glib::BoolError> {
|
||||
pub fn memory_mut(&mut self, idx: u32) -> Result<&mut GLMemoryRef, glib::BoolError> {
|
||||
unsafe { Ok(GLMemoryRef::from_mut_ptr(self.memory(idx)?.as_ptr() as _)) }
|
||||
}
|
||||
|
||||
|
@ -439,7 +439,7 @@ impl<'a> GLVideoFrameRef<&'a mut gst::BufferRef> {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn memory_mut(&self, idx: u32) -> Result<&mut GLMemoryRef, glib::BoolError> {
|
||||
pub fn memory_mut(&mut self, idx: u32) -> Result<&mut GLMemoryRef, glib::BoolError> {
|
||||
unsafe { Ok(GLMemoryRef::from_mut_ptr(self.memory(idx)?.as_ptr() as _)) }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1447,17 +1447,17 @@ impl Dump<'_> {
|
|||
let line = &line[..line_len];
|
||||
|
||||
match end_idx {
|
||||
0x00_00..=0xff_ff => write!(f, "{:04x}: ", start_idx)?,
|
||||
0x01_00_00..=0xff_ff_ff => write!(f, "{:06x}: ", start_idx)?,
|
||||
0x01_00_00_00..=0xff_ff_ff_ff => write!(f, "{:08x}: ", start_idx)?,
|
||||
_ => write!(f, "{:016x}: ", start_idx)?,
|
||||
0x00_00..=0xff_ff => write!(f, "{start_idx:04x}: ")?,
|
||||
0x01_00_00..=0xff_ff_ff => write!(f, "{start_idx:06x}: ")?,
|
||||
0x01_00_00_00..=0xff_ff_ff_ff => write!(f, "{start_idx:08x}: ")?,
|
||||
_ => write!(f, "{start_idx:016x}: ")?,
|
||||
}
|
||||
|
||||
for (i, v) in line.iter().enumerate() {
|
||||
if i > 0 {
|
||||
write!(f, " {:02x}", v)?;
|
||||
write!(f, " {v:02x}")?;
|
||||
} else {
|
||||
write!(f, "{:02x}", v)?;
|
||||
write!(f, "{v:02x}")?;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1487,9 +1487,9 @@ impl Dump<'_> {
|
|||
|
||||
for (i, v) in line.iter().enumerate() {
|
||||
if i > 0 {
|
||||
write!(f, " {:02x}", v)?;
|
||||
write!(f, " {v:02x}")?;
|
||||
} else {
|
||||
write!(f, "{:02x}", v)?;
|
||||
write!(f, "{v:02x}")?;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -79,17 +79,17 @@ impl Dump<'_> {
|
|||
if debug {
|
||||
for line in data.chunks(16) {
|
||||
match end_idx {
|
||||
0x00_00..=0xff_ff => write!(f, "{:04x}: ", start_idx)?,
|
||||
0x01_00_00..=0xff_ff_ff => write!(f, "{:06x}: ", start_idx)?,
|
||||
0x01_00_00_00..=0xff_ff_ff_ff => write!(f, "{:08x}: ", start_idx)?,
|
||||
_ => write!(f, "{:016x}: ", start_idx)?,
|
||||
0x00_00..=0xff_ff => write!(f, "{start_idx:04x}: ")?,
|
||||
0x01_00_00..=0xff_ff_ff => write!(f, "{start_idx:06x}: ")?,
|
||||
0x01_00_00_00..=0xff_ff_ff_ff => write!(f, "{start_idx:08x}: ")?,
|
||||
_ => write!(f, "{start_idx:016x}: ")?,
|
||||
}
|
||||
|
||||
for (i, v) in line.iter().enumerate() {
|
||||
if i > 0 {
|
||||
write!(f, " {:02x}", v)?;
|
||||
write!(f, " {v:02x}")?;
|
||||
} else {
|
||||
write!(f, "{:02x}", v)?;
|
||||
write!(f, "{v:02x}")?;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -117,9 +117,9 @@ impl Dump<'_> {
|
|||
for line in data.chunks(16) {
|
||||
for (i, v) in line.iter().enumerate() {
|
||||
if i > 0 {
|
||||
write!(f, " {:02x}", v)?;
|
||||
write!(f, " {v:02x}")?;
|
||||
} else {
|
||||
write!(f, "{:02x}", v)?;
|
||||
write!(f, "{v:02x}")?;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -169,8 +169,7 @@ unsafe impl<T: TracerImpl> IsSubclassable<T> for Tracer {
|
|||
return;
|
||||
}
|
||||
|
||||
let s = match crate::Structure::from_str(&format!("tracer-settings,{}", params))
|
||||
{
|
||||
let s = match crate::Structure::from_str(&format!("tracer-settings,{params}")) {
|
||||
Ok(s) => s,
|
||||
Err(err) => {
|
||||
emit_property_warning(
|
||||
|
|
|
@ -164,7 +164,7 @@ USAGE: Choose one of the following options, then press enter:
|
|||
}
|
||||
}
|
||||
Command::ReverseRate => {
|
||||
if send_seek_event(&pipeline, rate * -1.) {
|
||||
if send_seek_event(&pipeline, -rate) {
|
||||
rate *= -1.;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue