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

Remove DynamicOneShot trait. #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

reitermarkus
Copy link
Contributor

@reitermarkus reitermarkus commented Jan 18, 2024

From reading #10 (comment), it looks like adding this trait didn't actually solve the issue.

Depending on the device, this also allows reading invalid channels.

@reitermarkus reitermarkus force-pushed the remove-dynamic-one-shot branch 5 times, most recently from fe3a67a to 78aafb3 Compare January 19, 2024 14:21
Copy link
Owner

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Thanks! I fixed the CI now, could you rebase the PRs?

@coveralls
Copy link

coveralls commented Jan 29, 2024

Coverage Status

coverage: 81.385% (+0.2%) from 81.197%
when pulling 4f46a6e on reitermarkus:remove-dynamic-one-shot
into 0ff4c7b on eldruin:master.

@reitermarkus
Copy link
Contributor Author

@eldruin, rebased the PRs.

Copy link
Owner

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Thanks, I added some comments.

@@ -235,7 +235,7 @@ impl BitFlags {
}

pub mod channel;
pub use channel::{ChannelId, ChannelSelection};
pub use channel::ChannelId;
Copy link
Owner

Choose a reason for hiding this comment

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

I do not think we should expose ChannelSelection publicly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It isn't?

#[doc = $doc]
$CH,
)+
mod private {
Copy link
Owner

Choose a reason for hiding this comment

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

Why do you move this module inside this macro?

This comment was marked as outdated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This way the ChannelId is sealed by making ChannelSelection private.


/// Marker type for an ADC input channel.
pub trait ChannelId<T>: private::Sealed {
pub trait ChannelId<T> {
Copy link
Owner

Choose a reason for hiding this comment

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

Why should this trait not be sealed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is actually sealed since the ChannelSelection type is private.

@reitermarkus
Copy link
Contributor Author

@eldruin, can you have another look here? Thanks.

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

3 participants