@@ -182,7 +182,9 @@ mod toast {
182182 use iced:: advanced:: layout:: { self , Layout } ;
183183 use iced:: advanced:: overlay;
184184 use iced:: advanced:: renderer;
185- use iced:: advanced:: widget:: { self , Operation , Tree } ;
185+ use iced:: advanced:: widget:: {
186+ self , Operation , OperationOutputWrapper , Tree ,
187+ } ;
186188 use iced:: advanced:: { Clipboard , Shell , Widget } ;
187189 use iced:: event:: { self , Event } ;
188190 use iced:: mouse;
@@ -347,7 +349,7 @@ mod toast {
347349 . collect ( )
348350 }
349351
350- fn diff ( & self , tree : & mut Tree ) {
352+ fn diff ( & mut self , tree : & mut Tree ) {
351353 let instants = tree. state . downcast_mut :: < Vec < Option < Instant > > > ( ) ;
352354
353355 // Invalidating removed instants to None allows us to remove
@@ -368,8 +370,8 @@ mod toast {
368370 }
369371
370372 tree. diff_children (
371- & std:: iter:: once ( & self . content )
372- . chain ( self . toasts . iter ( ) )
373+ & mut std:: iter:: once ( & mut self . content )
374+ . chain ( self . toasts . iter_mut ( ) )
373375 . collect :: < Vec < _ > > ( ) ,
374376 ) ;
375377 }
@@ -379,7 +381,7 @@ mod toast {
379381 state : & mut Tree ,
380382 layout : Layout < ' _ > ,
381383 renderer : & Renderer ,
382- operation : & mut dyn Operation < Message > ,
384+ operation : & mut dyn Operation < OperationOutputWrapper < Message > > ,
383385 ) {
384386 operation. container ( None , & mut |operation| {
385387 self . content . as_widget ( ) . operate (
@@ -621,7 +623,7 @@ mod toast {
621623 & mut self ,
622624 layout : Layout < ' _ > ,
623625 renderer : & Renderer ,
624- operation : & mut dyn widget :: Operation < Message > ,
626+ operation : & mut dyn Operation < OperationOutputWrapper < Message > > ,
625627 ) {
626628 operation. container ( None , & mut |operation| {
627629 self . toasts
0 commit comments