player: fix various clippy issues

Fix uninlined_format_args warning
This commit is contained in:
Stéphane Cerveau 2023-02-13 16:39:33 +01:00
parent e2a62ae4d4
commit ae85402eeb
2 changed files with 6 additions and 5 deletions

View file

@ -66,7 +66,7 @@ impl ElementInfo {
if let Ok(factory) = feature.downcast::<gst::ElementFactory>() {
desc.push_str("<b>Factory details:</b>\n");
desc.push_str("<b>Rank:</b>");
let _ = write!(desc, "{:?}", rank);
let _ = write!(desc, "{rank:?}",);
desc.push('\n');
desc.push_str("<b>Name:</b>");
desc.push_str(&factory.name());

View file

@ -34,7 +34,7 @@ pub enum PipelineState {
impl fmt::Display for PipelineState {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{:?}", self)
write!(f, "{self:?}")
}
}
@ -46,7 +46,7 @@ impl ops::Deref for Player {
type Target = PlayerInner;
fn deref(&self) -> &PlayerInner {
&*self.0
&self.0
}
}
@ -325,6 +325,7 @@ impl Player {
}
// Render graph methods
#[allow(clippy::only_used_in_recursion)]
fn process_gst_node(
&self,
graphview: &GraphView,
@ -339,7 +340,7 @@ impl Player {
for (name, value) in node.properties().iter() {
//This allow to have an index in front of a property such as an enum.
if !node.hidden_property(name) {
let _ = write!(description, "{}={} ", name, value);
let _ = write!(description, "{name}={value} ");
}
}
//Port properties
@ -357,7 +358,7 @@ impl Player {
for port in ports {
if let Some((_port_to, node_to)) = graphview.port_connected_to(port.id()) {
if n_ports > 1 {
let _ = write!(description, "{}. ! ", unique_name);
let _ = write!(description, "{unique_name}. ! ");
} else {
description.push_str("! ");
}