Skip to content

Make operations on pins take mutable reference #25

Description

@Kixunil

I believe it'd be more logical to take mutable reference to pins. I know that memory itself doesn't change, however, there are good reasons to require mutability anyway:

  • Accessing the pin from multiple threads probably isn't what people want to do by accident. (They still can do it on purpose.)
  • Requiring mutable reference allows people to write mocks and simulate the pins in tests.
  • It's more natural to use mutable references when you change something.
  • It clearly shows that some state is being mutated.

What do you think?

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions