Skip to content

Commit

Permalink
Merge pull request #87 from oscartbeaumont/events-take-self
Browse files Browse the repository at this point in the history
make events take &self
  • Loading branch information
oscartbeaumont committed Apr 30, 2024
2 parents c34c1ef + 97a976b commit 10ceb87
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/event.rs
Expand Up @@ -147,7 +147,7 @@ pub trait Event: NamedType {
handle.once_any(meta.wrap_with_plugin(Self::NAME), make_handler!(handler))
}

fn emit<R: Runtime>(self, handle: &impl Manager<R>) -> tauri::Result<()>
fn emit<R: Runtime>(&self, handle: &impl Manager<R>) -> tauri::Result<()>
where
Self: Serialize + Clone,
{
Expand All @@ -156,7 +156,7 @@ pub trait Event: NamedType {
handle.emit(&meta.wrap_with_plugin(Self::NAME), self)
}

fn emit_to<R: Runtime>(self, handle: &impl Manager<R>, label: &str) -> tauri::Result<()>
fn emit_to<R: Runtime>(&self, handle: &impl Manager<R>, label: &str) -> tauri::Result<()>
where
Self: Serialize + Clone,
{
Expand All @@ -165,7 +165,7 @@ pub trait Event: NamedType {
handle.emit_to(label, &meta.wrap_with_plugin(Self::NAME), self)
}

fn emit_filter<F, R: Runtime>(self, handle: &impl Manager<R>, filter: F) -> tauri::Result<()>
fn emit_filter<F, R: Runtime>(&self, handle: &impl Manager<R>, filter: F) -> tauri::Result<()>
where
F: Fn(&EventTarget) -> bool,
Self: Serialize + Clone,
Expand Down

0 comments on commit 10ceb87

Please sign in to comment.