diff --git a/crates/notedeck/src/note/action.rs b/crates/notedeck/src/note/action.rs index 3d6c0000..1eba97aa 100644 --- a/crates/notedeck/src/note/action.rs +++ b/crates/notedeck/src/note/action.rs @@ -2,7 +2,7 @@ use super::context::ContextSelection; use crate::zaps::NoteZapTargetOwned; use enostr::{NoteId, Pubkey}; -#[derive(Debug, Eq, PartialEq, Clone)] +#[derive(Debug)] pub enum NoteAction { /// User has clicked the quote reply action Reply(NoteId), diff --git a/crates/notedeck_dave/src/ui/dave.rs b/crates/notedeck_dave/src/ui/dave.rs index 13cc8f25..81c7f424 100644 --- a/crates/notedeck_dave/src/ui/dave.rs +++ b/crates/notedeck_dave/src/ui/dave.rs @@ -16,7 +16,7 @@ pub struct DaveUi<'a> { /// The response the app generates. The response contains an optional /// action to take. -#[derive(Default, Clone, Debug)] +#[derive(Default, Debug)] pub struct DaveResponse { pub action: Option, } @@ -51,7 +51,7 @@ impl DaveResponse { /// The actions the app generates. No default action is specfied in the /// UI code. This is handled by the app logic, however it chooses to /// process this message. -#[derive(Clone, Debug)] +#[derive(Debug)] pub enum DaveAction { /// The action generated when the user sends a message to dave Send, diff --git a/crates/notedeck_ui/src/note/contents.rs b/crates/notedeck_ui/src/note/contents.rs index c840c7c6..8051a49c 100644 --- a/crates/notedeck_ui/src/note/contents.rs +++ b/crates/notedeck_ui/src/note/contents.rs @@ -17,7 +17,7 @@ pub struct NoteContents<'a, 'd> { txn: &'a Transaction, note: &'a Note<'a>, options: NoteOptions, - action: Option, + pub action: Option, } impl<'a, 'd> NoteContents<'a, 'd> { @@ -38,10 +38,6 @@ impl<'a, 'd> NoteContents<'a, 'd> { action: None, } } - - pub fn action(&self) -> &Option { - &self.action - } } impl egui::Widget for &mut NoteContents<'_, '_> { diff --git a/crates/notedeck_ui/src/note/mod.rs b/crates/notedeck_ui/src/note/mod.rs index 5c0c167a..b5756f16 100644 --- a/crates/notedeck_ui/src/note/mod.rs +++ b/crates/notedeck_ui/src/note/mod.rs @@ -442,8 +442,8 @@ impl<'a, 'd> NoteView<'a, 'd> { ui.add(&mut contents); - if let Some(action) = contents.action() { - note_action = Some(action.clone()); + if let Some(action) = contents.action { + note_action = Some(action); } if self.options().has_actionbar() { @@ -506,8 +506,8 @@ impl<'a, 'd> NoteView<'a, 'd> { ); ui.add(&mut contents); - if let Some(action) = contents.action() { - note_action = Some(action.clone()); + if let Some(action) = contents.action { + note_action = Some(action); } if self.options().has_actionbar() {