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

Should the try_now method in the Clock trait take a &mut self instead of &self? #99

Open
seanybaggins opened this issue Apr 15, 2021 · 4 comments

Comments

@seanybaggins
Copy link

seanybaggins commented Apr 15, 2021

It would be nice if try_now would update the internal state of the clock before attempting to return the time. As it currently stands, it is up to the user of the clock to make sure it is updated before they attempt to call try_now. Thoughts?

@seanybaggins seanybaggins changed the title Should the Clock trait take a &mut self instead of &self? Should the try_now method in the Clock trait take a &mut self instead of &self? Apr 15, 2021
@PTaylor-us
Copy link
Member

Sorry for the ridiculously long delay in responding. I'm really hoping to get back into a pattern of working on this crate.

In my implementations, I have been reading directly from hardware which doesn't necessitate changing the internal state of the Clock object. Do you have an implementation that would require that?

@eldruin
Copy link
Contributor

eldruin commented Aug 29, 2021

Here is some relevant discussion about this: #32

@PTaylor-us
Copy link
Member

@eldruin Thanks for the reminder. It's been awhile.

@eldruin
Copy link
Contributor

eldruin commented Aug 29, 2021

You are welcome Peter! nice to see you again :)

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

3 participants