Skip to content

Commit 4b94af9

Browse files
committed
acpi_tables: Fix clippy warnings related to no_std and prelude imports
See - rust-lang/rust#121362 the recommendation for how for no_std libraries has changed. To avoid warnings around unncessary imports (due to the prelude when compiling tests) make the tests also no_std and explicitly import the require test dependencies. Signed-off-by: Rob Bradford <[email protected]>
1 parent ca1a473 commit 4b94af9

File tree

11 files changed

+8
-5
lines changed

11 files changed

+8
-5
lines changed

src/aml.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1697,8 +1697,8 @@ impl<'a> Aml for PowerResource<'a> {
16971697

16981698
#[cfg(test)]
16991699
mod tests {
1700+
use alloc::borrow::ToOwned;
17001701
use super::*;
1701-
use std::vec;
17021702

17031703
#[test]
17041704
fn test_device() {

src/bert.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ aml_as_bytes!(BERT);
6262

6363
#[cfg(test)]
6464
mod tests {
65+
use alloc::vec::Vec;
6566
use super::*;
6667

6768
#[test]

src/fadt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ impl FADTBuilder {
245245

246246
#[cfg(test)]
247247
mod test {
248+
use alloc::vec::Vec;
248249
use super::{FADTBuilder, Flags, PmProfile};
249250
use crate::Aml;
250251

src/hmat.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,6 @@ impl Aml for MemorySideCache {
357357
#[cfg(test)]
358358
mod tests {
359359
use super::*;
360-
use crate::Aml;
361360

362361
fn check_checksum(hmat: &HMAT) {
363362
let mut bytes = Vec::new();

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66

77
#![crate_type = "staticlib"]
8-
#![cfg_attr(not(test), no_std)]
8+
#![no_std]
99

1010
//! ACPI table generation.
1111

src/madt.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,6 @@ aml_as_bytes!(PLIC);
649649
#[cfg(test)]
650650
mod tests {
651651
use super::*;
652-
use crate::Aml;
653652

654653
fn check_checksum(madt: &MADT) {
655654
let mut bytes = Vec::new();

src/rhct.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ impl Aml for MmuNode {
335335
#[cfg(test)]
336336
mod tests {
337337
use super::*;
338-
use crate::Aml;
339338

340339
#[test]
341340
fn test_rhct() {

src/rimt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ impl Aml for Platform {
492492

493493
#[cfg(test)]
494494
mod tests {
495+
use alloc::vec;
495496
use super::*;
496497

497498
fn rimt() -> RIMT {

src/spcr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ impl SerialPortInfo {
167167

168168
#[cfg(test)]
169169
mod tests {
170+
use alloc::vec::Vec;
170171
use super::*;
171172

172173
#[test]

src/tpm2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ impl Aml for Tpm2 {
304304

305305
#[cfg(test)]
306306
mod tests {
307+
use alloc::vec::Vec;
307308
use super::*;
308309
use crate::gas;
309310

src/xsdt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ impl Aml for XSDT {
7272

7373
#[cfg(test)]
7474
mod tests {
75+
use alloc::vec::Vec;
7576
use super::XSDT;
7677
use crate::Aml;
7778

0 commit comments

Comments
 (0)