Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LazyUpdate::exec uses a &mut ref? #761

Open
juliusl opened this issue Nov 29, 2022 · 1 comment
Open

LazyUpdate::exec uses a &mut ref? #761

juliusl opened this issue Nov 29, 2022 · 1 comment
Labels

Comments

@juliusl
Copy link

juliusl commented Nov 29, 2022

Description

LazyUpdate has two exec fn's, exec and exec_mut. However it looks like their function signatures are identical?

specs/src/world/lazy.rs

Lines 303 to 305 in 81073f3

pub fn exec<F>(&self, f: F)
where
F: FnOnce(&mut World) + 'static,

specs/src/world/lazy.rs

Lines 337 to 339 in 81073f3

pub fn exec_mut<F>(&self, f: F)
where
F: FnOnce(&mut World) + 'static,

I was wondering what is the difference between the two?

@juliusl juliusl added the bug label Nov 29, 2022
@juliusl juliusl changed the title Lazy::exec uses a &mut ref? LazyUpdate::exec uses a &mut ref? Nov 30, 2022
@Imberflur
Copy link
Contributor

looks like they became the same in b4e83ce

I don't see any reason to have a &World variant here so they can probably be merged into a single method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants