chore: Fix clippy warnings

This commit is contained in:
Fabio Lenherr / DashieTM 2024-04-01 14:49:59 +02:00
parent d72f916e8a
commit f2e833eae5
3 changed files with 17 additions and 20 deletions

View file

@ -3,18 +3,17 @@ use std::rc::Rc;
use std::sync::Arc;
use gtk::FlowBox;
use re_set_lib::utils::plugin::SidebarInfo;
use crate::components::base::utils::{Listeners, Position};
extern "C" {
pub fn startup() -> SidebarInfo;
pub fn shutdown();
pub fn run_test();
}
// extern "C" {
// pub fn startup() -> SidebarInfo;
// pub fn shutdown();
// pub fn run_test();
// }
type RegularClickEvent = fn(Arc<Listeners>, FlowBox, Rc<RefCell<Position>>);
type PluginClickEvent = Rc<dyn Fn(FlowBox, Rc<RefCell<Position>>, Vec<gtk::Box>)>;
pub type RegularClickEvent = fn(Arc<Listeners>, FlowBox, Rc<RefCell<Position>>);
pub type PluginClickEvent = Rc<dyn Fn(FlowBox, Rc<RefCell<Position>>, Vec<gtk::Box>)>;
pub trait TSideBarInfo {
fn name(&self) -> &'static str;

View file

@ -1,13 +1,11 @@
use std::rc::Rc;
use crate::components::plugin::function::{PluginSidebarInfo, ReSetSidebarInfo, TSideBarInfo};
use crate::components::plugin::function::{TSideBarInfo};
use crate::components::window::sidebar_entry_impl;
use crate::components::window::sidebar_entry_impl::SidebarAction;
use adw::subclass::prelude::ObjectSubclassIsExt;
use glib::Object;
use gtk::prelude::*;
use super::handle_sidebar_click::HANDLE_HOME;
glib::wrapper! {
pub struct SidebarEntry(ObjectSubclass<sidebar_entry_impl::SidebarEntry>)

View file

@ -1,20 +1,20 @@
use std::cell::{Cell, RefCell};
use std::cell::RefCell;
use std::rc::Rc;
use std::sync::Arc;
use glib::subclass::InitializingObject;
use gtk::subclass::prelude::*;
use gtk::{CompositeTemplate, FlowBox, Image, Label, ListBoxRow};
use gtk::{CompositeTemplate, Image, Label, ListBoxRow};
use crate::components::base::utils::{Listeners, Position};
use crate::components::plugin::function::{PluginClickEvent, RegularClickEvent};
use crate::components::window::handle_sidebar_click::HANDLE_HOME;
use crate::components::window::sidebar_entry;
#[derive(Default)]
pub enum Categories {
Connectivity,
Audio,
Peripherals,
// TODO: are these ever used ?
// Connectivity,
// Audio,
// Peripherals,
#[default]
Misc,
}
@ -33,8 +33,8 @@ pub struct SidebarEntry {
}
pub struct SidebarAction {
pub on_click_event: Option<fn(Arc<Listeners>, FlowBox, Rc<RefCell<Position>>)>,
pub on_plugin_click_event: Rc<dyn Fn(FlowBox, Rc<RefCell<Position>>, Vec<gtk::Box>)>,
pub on_click_event: Option<RegularClickEvent>,
pub on_plugin_click_event: PluginClickEvent,
}
impl Default for SidebarAction {