From 00830f4e5569a381afbdfce270e478c5fd25401f Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 10 Jun 2024 21:56:37 +0000 Subject: Remove `DynamicOneShot` trait. (#19) * Remove `DynamicOneShot` trait. * Update changelog. --- src/channel.rs | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'src/channel.rs') diff --git a/src/channel.rs b/src/channel.rs index 27262d4..4b7555e 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -1,33 +1,31 @@ //! ADC input channels use crate::{ic, Ads1x1x, BitFlags as BF, Config}; -mod private { - pub trait Sealed {} -} +use private::ChannelSelection; /// Marker type for an ADC input channel. -pub trait ChannelId: private::Sealed { +pub trait ChannelId { /// Get the channel. fn channel_id() -> ChannelSelection; } macro_rules! impl_channels { ($(#[doc = $doc:expr] $CH:ident => [$($IC:ident),+]),+ $(,)?) => { - #[derive(Debug, Clone, Copy)] - /// ADC input channel selection. - pub enum ChannelSelection { - $( - #[doc = $doc] - $CH, - )+ + mod private { + #[derive(Debug, Clone, Copy)] + /// ADC input channel selection. + pub enum ChannelSelection { + $( + #[doc = $doc] + $CH, + )+ + } } $( #[doc = $doc] pub struct $CH; - impl private::Sealed for $CH {} - $( impl ChannelId> for $CH { fn channel_id() -> ChannelSelection { -- cgit v1.2.3-54-g00ecf