Skip to content

Commit 4a5f512

Browse files
committed
Restrict ADC ID type to Copy types
This fixes a deny-by-default clippy lint: ``` error: a `const` item should never be interior mutable --> src/adc.rs:47:5 | 47 | const CHANNEL: Self::ID; | ^^^^^^^^^^^^^^^--------^ | | | consider requiring `<Self as adc::Channel<ADC>>::ID` to be `Copy` | = note: `#[deny(clippy::declare_interior_mutable_const)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const ``` Signed-off-by: Daniel Egger <[email protected]>
1 parent 181d44b commit 4a5f512

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/adc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub trait Channel<ADC> {
4040
/// A type used to identify this ADC channel. For example, if the ADC has eight channels, this
4141
/// might be a `u8`. If the ADC has multiple banks of channels, it could be a tuple, like
4242
/// `(u8: bank_id, u8: channel_id)`.
43-
type ID;
43+
type ID: Copy;
4444

4545
/// Get the specific ID that identifies this channel, for example `0_u8` for the first ADC
4646
/// channel, if Self::ID is u8.

0 commit comments

Comments
 (0)