Skip to content

Commit 9e18e3a

Browse files
examples: Adapt to nullable annotation
1 parent 2a2874a commit 9e18e3a

File tree

1 file changed

+1
-1
lines changed
  • examples/confetti_snapshot_animation

1 file changed

+1
-1
lines changed

examples/confetti_snapshot_animation/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn build_ui(application: &gtk::Application) {
2929
// `ConfettiWidget`
3030
let ev_ctrl = gtk::GestureClick::new();
3131
ev_ctrl.connect_pressed(move |event, _, x, y| {
32-
let confetti = event.widget().downcast::<ConfettiWidget>().unwrap();
32+
let confetti = event.widget().and_downcast::<ConfettiWidget>().unwrap();
3333
let params = ExplosionParameters {
3434
quantity: 25,
3535
acceleration: Vec2::new(0.0, 1.0 / 1000.0),

0 commit comments

Comments
 (0)