]> uap-core.de Git - note.git/commitdiff
fix some warnings main
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Sat, 6 Jun 2026 08:17:27 +0000 (10:17 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Sat, 6 Jun 2026 08:17:27 +0000 (10:17 +0200)
application/src/note.rs
application/src/notebook.rs
application/src/window.rs

index d7111ff8d03fc8e00fb5f434703a1f1c00e13742..118820faf0dd4ada0be8c452a88668b3e54c714a 100644 (file)
@@ -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 {
index a97c4df37d678c2aa5dbe4724be4eb18ee076122..66f43471c89c3d2752071f85c035c16e6736dd18 100644 (file)
@@ -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,
index c4fcf7dbdda9afc16c9597134d6a66d8a06162b6..c3b968dc7c3ace6fd320fa899d0600f6c1d9fe13 100644 (file)
@@ -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(&notebook_doc);
         self.selected_notebook = Some(notebook_doc);
 
-        if let Some(note_id) = &nav.note_id {
+        if nav.note_id.is_some() {
             let arg: Box<dyn Any> = 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<NoteId>
 }
 
-enum NavDirection {
+pub enum NavDirection {
     Forward,
     Backward
 }
\ No newline at end of file