Skip to content

Commit

Permalink
Added Send + Sync traits
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorBP committed Nov 13, 2023
1 parent 4ab1fe0 commit dabf3e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub const WARNING_COLOR: Color32 = Color32::from_rgb(255, 212, 0);
pub const ERROR_COLOR: Color32 = Color32::from_rgb(255, 32, 0);
pub const SUCCESS_COLOR: Color32 = Color32::from_rgb(0, 255, 32);

pub type ToastContents = Arc<dyn Fn(&mut Ui, &mut Toast) -> Response>;
pub type ToastContents = Arc<dyn Fn(&mut Ui, &mut Toast) -> Response + Send + Sync>;

pub struct Toasts {
id: Id,
Expand Down Expand Up @@ -143,7 +143,7 @@ impl Toasts {
pub fn custom_contents(
mut self,
kind: impl Into<ToastKind>,
add_contents: Arc<impl Fn(&mut Ui, &mut Toast) -> Response + 'static>,
add_contents: Arc<impl Fn(&mut Ui, &mut Toast) -> Response + Send + Sync + 'static>,
) -> Self {
self.custom_toast_contents
.insert(kind.into(), Box::new(add_contents));
Expand Down

0 comments on commit dabf3e2

Please sign in to comment.