fix clippy warnings

This commit is contained in:
Tom A. Wagner
2023-08-01 09:13:16 +02:00
parent 7a9bc84b8b
commit a9ad1cccf0
6 changed files with 13 additions and 7 deletions

View File

@@ -113,7 +113,7 @@ impl Application {
pw_sender: Sender<GtkMessage>,
) -> Self {
let app: Application = glib::Object::builder()
.property("application-id", &"org.pipewire.Helvum")
.property("application-id", "org.pipewire.Helvum")
.build();
let imp = app.imp();

View File

@@ -717,7 +717,7 @@ impl GraphView {
pub(super) fn move_node(&self, widget: &Node, point: &Point) {
let mut nodes = self.imp().nodes.borrow_mut();
let mut node = nodes
let node = nodes
.get_mut(&widget.pipewire_id())
.expect("Node is not on the graph");

View File

@@ -112,3 +112,9 @@ impl Link {
self.set_property("active", active);
}
}
impl Default for Link {
fn default() -> Self {
Self::new()
}
}

View File

@@ -115,8 +115,8 @@ glib::wrapper! {
impl Node {
pub fn new(name: &str, pipewire_id: u32) -> Self {
glib::Object::builder()
.property("name", &name)
.property("pipewire-id", &pipewire_id)
.property("name", name)
.property("pipewire-id", pipewire_id)
.build()
}

View File

@@ -125,8 +125,8 @@ impl Port {
pub fn new(id: u32, name: &str, direction: Direction, media_type: Option<MediaType>) -> Self {
// Create the widget and initialize needed fields
let res: Self = glib::Object::builder()
.property("pipewire-id", &id)
.property("name", &name)
.property("pipewire-id", id)
.property("name", name)
.build();
let imp = res.imp();

View File

@@ -151,7 +151,7 @@ mod imp {
fn update_zoom_factor_text(&self, zoom_factor: f64) {
self.entry
.buffer()
.set_text(&format!("{factor:.0}%", factor = zoom_factor * 100.));
.set_text(format!("{factor:.0}%", factor = zoom_factor * 100.));
}
}
}