mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-24 03:24:21 +01:00
note: remove unnecessary derive macros from NoteAction
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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<'_, '_> {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user