Hands-on Rust: Different between "add_component" and "push" to command buffer (page 139)

In Page 137, the book uses “add component” to add something o the CommandBuffer, it does:

.add_component(want_move.entity, want_move.destination)

In page 139, the book uses push, it does:

.push(((), WantsToMove{entity: *entity, destination}));

I think it should be clarified what’s the different between them, or when to use one or the other.

Thank you! I’ve put this into the bug tracker. If a 2nd edition comes along, it’ll be fixed then. I agree that could definitely be clarified. push is used when directly adding components/entities. The buffered update is used in systems - and doesn’t apply them until the next flush in the system executor. This avoids some memory nastiness (invalidating queries by changing the data they are looking at).