chiark / gitweb /
Replace an open-coded into_unprepared call
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 1 May 2022 01:38:13 +0000 (02:38 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 1 May 2022 01:38:13 +0000 (02:38 +0100)
Found this will looking at this code.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
daemon/cmdlistener.rs

index e1fb0b121ab641641824ca98e2eccb64868e988f..6745b26040cd5ea3bbda4bcb93c3cb5533945193 100644 (file)
@@ -1058,13 +1058,7 @@ fn execute_game_insn<'cs, 'igr, 'ig: 'igr>(
           }],
           raw: None },
        Fine,
-       if xupdates.len() != 0 {
-         vec![
-           Box::new(move |prepub: &mut PrepareUpdatesBuffer|
-                    prepub.piece_updates(xupdates, &None))
-             as SomeUnpreparedUpdates
-         ]
-       } else { default() },
+       xupdates.into_unprepared(None),
        vec![],
        ig_g)
     },