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

Add a wrapper around TrackedDeviceIndex_t. #11

Merged
merged 3 commits into from
Feb 12, 2023

Conversation

kitlith
Copy link
Contributor

@kitlith kitlith commented Jan 22, 2023

I'll rebase #8 and #10 on top of this one once this looks good.

src/lib.rs Outdated
#[repr(transparent)]
pub struct TrackedDeviceIndex(pub sys::TrackedDeviceIndex_t);
impl TrackedDeviceIndex {
pub const fn new(index: sys::TrackedDeviceIndex_t) -> Option<Self> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would opt for a result here instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not resolving yet, as I've only changed it to Result<Self, ()> since I don't have a good error type for this yet.

Answer might be to make a unit struct that has conversions into relevant error types eventually.

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
sys/src/lib.rs Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
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.

None yet

2 participants