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

Impl Deref and DerefMut #11

Open
jamwaffles opened this issue Feb 16, 2020 · 0 comments
Open

Impl Deref and DerefMut #11

jamwaffles opened this issue Feb 16, 2020 · 0 comments

Comments

@jamwaffles
Copy link
Owner

Makes life easier. Instead of:

output_1.set_value(time.into())?;
input_1.value()?;

We can do this:

*output_1 = time.into();
*input_1;

Docs must mention that a deref can panic, and that the programmer should use .value()/.set_value() for a non-panicking impl.

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

1 participant