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

Make operations on pins take mutable reference #25

Open
Kixunil opened this issue Dec 12, 2016 · 1 comment
Open

Make operations on pins take mutable reference #25

Kixunil opened this issue Dec 12, 2016 · 1 comment

Comments

@Kixunil
Copy link

Kixunil commented Dec 12, 2016

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?

@SaberYoun6
Copy link

How would your try and impliment this into the code?

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

No branches or pull requests

2 participants