diff --git a/crates/egui/src/grid.rs b/crates/egui/src/grid.rs index eb33e00e..acd5c357 100644 --- a/crates/egui/src/grid.rs +++ b/crates/egui/src/grid.rs @@ -47,7 +47,7 @@ impl State { // ---------------------------------------------------------------------------- // type alias for boxed function to determine row color during grid generation -type ColorPickerFn = Box Option>; +type ColorPickerFn = Box Option>; pub(crate) struct GridLayout { ctx: Context, @@ -312,7 +312,7 @@ impl Grid { /// Setting this will allow for dynamic coloring of rows of the grid object pub fn with_row_color(mut self, color_picker: F) -> Self where - F: Fn(usize, &Style) -> Option + 'static, + F: Send + Sync + Fn(usize, &Style) -> Option + 'static, { self.color_picker = Some(Box::new(color_picker)); self diff --git a/crates/egui/src/ui.rs b/crates/egui/src/ui.rs index 83713e48..e29a4009 100644 --- a/crates/egui/src/ui.rs +++ b/crates/egui/src/ui.rs @@ -2245,3 +2245,9 @@ impl Ui { } } } + +#[test] +fn ui_impl_send_sync() { + fn assert_send_sync() {} + assert_send_sync::(); +}