Skip to content

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

Open

Description

@juliusl

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?

Activity

  1. changed the title [-]Lazy::exec uses a &mut ref?[/-] [+]LazyUpdate::exec uses a &mut ref?[/+] on Nov 30, 2022
  2. Imberflur commented on Sep 15, 2023

    @Imberflur
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions