bevy
bevy copied to clipboard
Rename `ArgList::push` methods to `with` and add new `push` methods which take `&mut self`
Objective
The ArgList::push family of methods consume self and return a new ArgList which means they can't be used with &mut ArgList references.
fn foo(args: &mut ArgList) {
args.push_owned(47_i32); // doesn't work :(
}
It's typical for push methods on other existing types to take &mut self.
Solution
Renamed the existing push methods to with_arg, with_ref etc and added new push methods which take &mut self.
Migration Guide
Uses of the ArgList::push methods should be replaced with the with counterpart.
| old | new |
|---|---|
| push_arg | with_arg |
| push_ref | with_ref |
| push_mut | with_mut |
| push_owned | with_owned |
| push_boxed | with_boxed |