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

allow customizing the reason and consumer #5

Merged
merged 2 commits into from
Nov 11, 2022

Conversation

connor4312
Copy link
Contributor

@connor4312 connor4312 commented Nov 11, 2022

I think a builder might be nicer for the AwakeOptions, but I started with the simpler change for now 🙂 Unfortunately, since it isn't a builder and not #[not_exhaustive], adding any new struct fields is technically breaking.

I also dropped the Copy trait, since strings are not copyable. But I think that's fine -- if Awake takes AwakeOptions instead of a reference to them, and doesn't store a duplicate _options, then there's no need to clone or copy them.

Fixes #4

@segevfiner segevfiner self-requested a review November 11, 2022 22:44
src/sys/linux.rs Outdated Show resolved Hide resolved
src/sys/linux.rs Outdated Show resolved Hide resolved
@segevfiner segevfiner merged commit 2e7630c into segevfiner:main Nov 11, 2022
@connor4312 connor4312 deleted the custom-reason branch November 11, 2022 23:36
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

Successfully merging this pull request may close these issues.

Allow consumers to provide a reason and consumer for sleep deprivation
2 participants