Skip to content

Commit

Permalink
Make some changes suggested by clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
andy128k committed Sep 17, 2023
1 parent daa384c commit 2638c35
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/ui/file_pane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ impl FilePane {
// move to a group
let children = group.children().expect("Only a group can be a destination");
for record in records {
children.append(&record);
children.append(record);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/forms/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl FormWidget<String> for gtk::Entry {
}

fn get_value(&self) -> Option<String> {
get_value(&self)
get_value(self)
}

fn set_value(&self, value: Option<&String>) {
Expand Down
6 changes: 4 additions & 2 deletions src/ui/record_view/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,13 @@ glib::wrapper! {
@extends gtk::Widget;
}

impl PSRecordViewItem {
pub fn new() -> Self {
impl Default for PSRecordViewItem {
fn default() -> Self {
glib::Object::builder().build()
}
}

impl PSRecordViewItem {
pub fn set_record_node(&self, record_node: Option<RecordNode>) {
self.imp().set_record_node(record_node);
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/record_view/item_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub fn item_factory(
) -> gtk::ListItemFactory {
let factory = gtk::SignalListItemFactory::new();
factory.connect_setup(move |_factory, list_item| {
let child = PSRecordViewItem::new();
let child = PSRecordViewItem::default();
let popup_model = popup_model.clone();
child.connect_context_menu(move |_record| popup_model.borrow().clone());
list_item.set_child(Some(&child));
Expand Down

0 comments on commit 2638c35

Please sign in to comment.