Merge pull request #394 from eZioPan/remove-clippy-warning

remove clippy warning and error from genrated files.
This commit is contained in:
Dario Nieuwenhuis 2024-02-15 19:34:21 +00:00 committed by GitHub
commit 156c0ec278
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -186,9 +186,9 @@ impl Gen {
write!(
&mut data,
"
pub(crate) static PERIPHERALS: &'static [Peripheral] = {};
pub(crate) static INTERRUPTS: &'static [Interrupt] = {};
pub(crate) static DMA_CHANNELS: &'static [DmaChannel] = {};
pub(crate) static PERIPHERALS: &[Peripheral] = {};
pub(crate) static INTERRUPTS: &[Interrupt] = {};
pub(crate) static DMA_CHANNELS: &[DmaChannel] = {};
",
stringify(&core.peripherals),
stringify(&core.interrupts),
@ -329,6 +329,16 @@ impl Gen {
.join(format!("{}_{}.rs", module, version)),
)
.unwrap();
// Allow a few warning
file.write_all(
b"#![allow(clippy::missing_safety_doc)]
#![allow(clippy::identity_op)]
#![allow(clippy::unnecessary_cast)]
#![allow(clippy::erasing_op)]",
)
.unwrap();
let data = items.to_string().replace("] ", "]\n");
// Remove inner attributes like #![no_std]