Implement cargo and clippy fixes
This commit is contained in:
parent
015e40c187
commit
f4bbbc330c
@ -5,7 +5,7 @@ use std::{env, path::PathBuf, process};
|
||||
|
||||
use gtk::prelude::*;
|
||||
use mcdu::McduModel;
|
||||
use relm4::{gtk::PolicyType, prelude::*};
|
||||
use relm4::prelude::*;
|
||||
use sheet_listing::SheetListingModel;
|
||||
|
||||
struct AppModel {
|
||||
|
@ -1,10 +1,10 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use gtk::prelude::*;
|
||||
use relm4::prelude::*;
|
||||
use relm4::{
|
||||
gtk, Component, ComponentController, ComponentParts, ComponentSender, SimpleComponent,
|
||||
};
|
||||
use relm4::{gtk::PolicyType, prelude::*};
|
||||
use walkdir::WalkDir;
|
||||
|
||||
pub struct SheetModel {
|
||||
@ -32,7 +32,7 @@ impl SimpleComponent for SheetModel {
|
||||
fn init(
|
||||
path: Self::Init,
|
||||
root: &Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
_sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let model = SheetModel { path };
|
||||
let widgets = view_output!();
|
||||
@ -42,30 +42,23 @@ impl SimpleComponent for SheetModel {
|
||||
|
||||
pub struct SheetListingModel;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum SheetListingOutput {
|
||||
ButtonPress(char),
|
||||
}
|
||||
|
||||
#[relm4::component(pub)]
|
||||
impl SimpleComponent for SheetListingModel {
|
||||
type Init = PathBuf;
|
||||
type Input = ();
|
||||
type Output = SheetListingOutput;
|
||||
type Output = ();
|
||||
|
||||
view! {
|
||||
#[root]
|
||||
gtk::Box {
|
||||
set_orientation: gtk::Orientation::Vertical,
|
||||
// set_column_spacing: 5,
|
||||
// set_row_spacing: 5,
|
||||
}
|
||||
}
|
||||
|
||||
fn init(
|
||||
dir: Self::Init,
|
||||
root: &Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
_sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
for entry in WalkDir::new(dir)
|
||||
.into_iter()
|
||||
@ -78,8 +71,6 @@ impl SimpleComponent for SheetListingModel {
|
||||
.unwrap_or(false)
|
||||
})
|
||||
{
|
||||
// println!("{}", entry.display());
|
||||
|
||||
let sheet_model = SheetModel::builder().launch(entry);
|
||||
root.append(sheet_model.widget());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user