commit e6212e5d170f2bbfe130ce6807aa32f2262eb016
parent b9e2daf47abc1bcf929b358ccf71ee98737b7392
Author: kernelkind <kernelkind@gmail.com>
Date: Tue, 29 Apr 2025 13:04:50 -0400
note: remove unnecessary derive macros from `NoteAction`
Signed-off-by: kernelkind <kernelkind@gmail.com>
Diffstat:
4 files changed, 8 insertions(+), 12 deletions(-)
diff --git 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
@@ -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<DaveAction>,
}
@@ -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
@@ -17,7 +17,7 @@ pub struct NoteContents<'a, 'd> {
txn: &'a Transaction,
note: &'a Note<'a>,
options: NoteOptions,
- action: Option<NoteAction>,
+ pub action: Option<NoteAction>,
}
impl<'a, 'd> NoteContents<'a, 'd> {
@@ -38,10 +38,6 @@ impl<'a, 'd> NoteContents<'a, 'd> {
action: None,
}
}
-
- pub fn action(&self) -> &Option<NoteAction> {
- &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
@@ -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() {