@@ -211,16 +211,16 @@ pub fn grid_overlay(document: &DocumentMessageHandler, overlay_context: &mut Ove
211211
212212pub fn overlay_options ( grid : & GridSnapping ) -> Vec < LayoutGroup > {
213213 let mut widgets = Vec :: new ( ) ;
214- fn update_val < I > ( grid : & GridSnapping , update : impl Fn ( & mut GridSnapping , & I ) ) -> impl Fn ( & I ) -> Message {
215- let grid = grid. clone ( ) ;
214+ fn update_val < I , F : Fn ( & mut GridSnapping , & I ) > ( grid : & GridSnapping , update : F ) -> impl Fn ( & I ) -> Message + use < I , F > {
215+ let new_grid = grid. clone ( ) ;
216216 move |input : & I | {
217- let mut grid = grid . clone ( ) ;
217+ let mut grid = new_grid . clone ( ) ;
218218 update ( & mut grid, input) ;
219219 DocumentMessage :: GridOptions ( grid) . into ( )
220220 }
221221 }
222222 let update_origin = |grid, update : fn ( & mut GridSnapping ) -> Option < & mut f64 > | {
223- update_val :: < NumberInput > ( grid, move |grid, val| {
223+ update_val :: < NumberInput , _ > ( grid, move |grid, val| {
224224 if let Some ( val) = val. value {
225225 if let Some ( update) = update ( grid) {
226226 * update = val;
@@ -229,7 +229,7 @@ pub fn overlay_options(grid: &GridSnapping) -> Vec<LayoutGroup> {
229229 } )
230230 } ;
231231 let update_color = |grid, update : fn ( & mut GridSnapping ) -> Option < & mut Color > | {
232- update_val :: < ColorInput > ( grid, move |grid, color| {
232+ update_val :: < ColorInput , _ > ( grid, move |grid, color| {
233233 if let FillChoice :: Solid ( color) = color. value {
234234 if let Some ( update_color) = update ( grid) {
235235 * update_color = color;
@@ -238,7 +238,7 @@ pub fn overlay_options(grid: &GridSnapping) -> Vec<LayoutGroup> {
238238 } )
239239 } ;
240240 let update_display = |grid, update : fn ( & mut GridSnapping ) -> Option < & mut bool > | {
241- update_val :: < CheckboxInput > ( grid, move |grid, checkbox| {
241+ update_val :: < CheckboxInput , _ > ( grid, move |grid, checkbox| {
242242 if let Some ( update) = update ( grid) {
243243 * update = checkbox. checked ;
244244 }
0 commit comments