Skip to content

Commit

Permalink
fix: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Leander Beernaert committed Jan 3, 2025
1 parent 78ccb6d commit 0669c49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
14 changes: 7 additions & 7 deletions you-have-mail-mobile/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ pub struct Action(String);
uniffi::custom_newtype!(Action, String);

impl From<yhm::backend::Action> for Action {
fn from(action: yhm::backend::Action) -> Self {
Self(action.take())
}
fn from(action: yhm::backend::Action) -> Self {
Self(action.take())
}
}

impl From<Action> for yhm::backend::Action {
impl From<Action> for yhm::backend::Action {
fn from(action: Action) -> Self {
yhm::backend::Action::with(action.0)
}
Expand All @@ -22,9 +22,9 @@ impl From<Action> for yhm::backend::Action {
pub struct NewEmail {
pub sender: String,
pub subject: String,
pub move_to_trash_action:Option<Action>,
pub move_to_spam_action:Option<Action>,
pub mark_as_read_action:Option<Action>,
pub move_to_trash_action: Option<Action>,
pub move_to_spam_action: Option<Action>,
pub mark_as_read_action: Option<Action>,
}
#[derive(uniffi::Enum)]
pub enum Event {
Expand Down
7 changes: 3 additions & 4 deletions you-have-mail-mobile/src/yhm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,14 @@ impl Yhm {
.into())
}


/// Apply the `action` to the account with `email`.
///
/// # Errors
///
/// Returns error if the action failed.
pub fn apply_action(&self, email:&str, action:Action) -> Result<(), YhmError> {
let action = action.into();
Ok(self.yhm.apply_actions(email,[action])?)
pub fn apply_action(&self, email: &str, action: Action) -> Result<(), YhmError> {
let action = action.into();
Ok(self.yhm.apply_actions(email, [action])?)
}
}

Expand Down

0 comments on commit 0669c49

Please sign in to comment.