From: Olaf Wintermann Date: Sat, 6 Jun 2026 08:17:27 +0000 (+0200) Subject: fix some warnings X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=HEAD;p=note.git fix some warnings --- diff --git a/application/src/note.rs b/application/src/note.rs index d7111ff..118820f 100644 --- a/application/src/note.rs +++ b/application/src/note.rs @@ -1,6 +1,5 @@ use std::rc::Rc; use std::sync::atomic::{AtomicU64, Ordering}; -use sea_orm::prelude::DateTimeWithTimeZone; use sea_orm::sea_query::prelude::Utc; use sea_orm::{NotSet, Set}; use entity::note::NoteType; @@ -135,7 +134,7 @@ impl Note { let (note_id, created) = match &self.id { NoteId::Id(id) => (Set(*id), NotSet), - NoteId::TmpId(t) => (NotSet, Set(Utc::now().into())) + NoteId::TmpId(_) => (NotSet, Set(Utc::now().into())) }; let note = entity::note::ActiveModel { diff --git a/application/src/notebook.rs b/application/src/notebook.rs index a97c4df..66f4347 100644 --- a/application/src/notebook.rs +++ b/application/src/notebook.rs @@ -238,7 +238,7 @@ impl Drop for Notebook { } } -enum NoteSelectFrom<'a> { +pub enum NoteSelectFrom<'a> { ListSelection(&'a ListSelection), NavigationItem(NavigationItem), } @@ -313,10 +313,6 @@ impl NoteItem { } pub fn new(id: NoteId) -> Self { - let tmp_id = match id { - NoteId::Id(id) => 0, - NoteId::TmpId(id) => id - }; let mut item = NoteItem { id: id.clone(), orig_id: id, diff --git a/application/src/window.rs b/application/src/window.rs index c4fcf7d..c3b968d 100644 --- a/application/src/window.rs +++ b/application/src/window.rs @@ -114,7 +114,7 @@ impl MainWindow { }?; let mut obj = self.obj.get_object()?; let (sl, i) = find_notebook(&self.notebooks, nav.collection_id)?; - let mut sublist = self.notebooks.get_mut(sl)?; + let sublist = self.notebooks.get_mut(sl)?; sublist.list().set_selected_index(i as i32); let notebook = sublist.data_mut().get_mut(i)?; @@ -128,7 +128,7 @@ impl MainWindow { obj.ctx.attach(¬ebook_doc); self.selected_notebook = Some(notebook_doc); - if let Some(note_id) = &nav.note_id { + if nav.note_id.is_some() { let arg: Box = Box::new(nav.clone()); obj.ctx.call_action_with_parameter("navigate_to_note", arg); } @@ -335,7 +335,7 @@ pub struct NavigationItem { pub note_id: Option } -enum NavDirection { +pub enum NavDirection { Forward, Backward } \ No newline at end of file