Skip to content

Commit 1d6e6ae

Browse files
Merge #217
217: Restrict ADC ID type to Copy types r=ryankurte a=therealprof 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]> Co-authored-by: Daniel Egger <[email protected]>
2 parents 181d44b + 4a5f512 commit 1d6e6ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/adc.rs

+1-1
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)