Pārlūkot izejas kodu

Run `cargo fix --edition` to update crate for rust 2018

Atul Bhosale 6 gadi atpakaļ
vecāks
revīzija
2612f1a5aa
8 mainītis faili ar 32 papildinājumiem un 32 dzēšanām
  1. 2 2
      src/aml/mod.rs
  2. 2 2
      src/aml/parser.rs
  3. 4 4
      src/fadt.rs
  4. 2 2
      src/hpet.rs
  5. 7 7
      src/lib.rs
  6. 5 5
      src/madt.rs
  7. 3 3
      src/rsdp_search.rs
  8. 7 7
      src/sdt.rs

+ 2 - 2
src/aml/mod.rs

@@ -9,8 +9,8 @@ use self::parser::AmlParser;
 use self::stream::AmlStream;
 use alloc::string::String;
 use core::{mem, slice};
-use sdt::SdtHeader;
-use {Acpi, AcpiError, AcpiHandler, PhysicalMapping};
+use crate::sdt::SdtHeader;
+use crate::{Acpi, AcpiError, AcpiHandler, PhysicalMapping};
 
 /// Represents a table containing AML. For ACPI Version 2+, this is just the DSDT and SSDTs.
 /// Version 1.0 may also have a PSDT.

+ 2 - 2
src/aml/parser.rs

@@ -4,7 +4,7 @@ use super::{opcodes, AmlError};
 use alloc::string::String;
 use bit_field::BitField;
 use core::str;
-use {Acpi, AcpiHandler};
+use crate::{Acpi, AcpiHandler};
 
 /// This is used internally by the parser to keep track of what we know about a field before we can
 /// add it to the namespace.
@@ -159,7 +159,7 @@ where
         let containing_scope = self.scope.clone();
 
         self.scope = name_string;
-        let term_list = self.parse_term_list(scope_end_offset)?;
+        let _term_list = self.parse_term_list(scope_end_offset)?;
         self.scope = containing_scope;
 
         Ok(())

+ 4 - 4
src/fadt.rs

@@ -1,7 +1,7 @@
-use aml::{parse_aml_table, AmlTable};
-use sdt;
-use sdt::SdtHeader;
-use {Acpi, AcpiError, AcpiHandler, GenericAddress, PhysicalMapping};
+use crate::aml::{parse_aml_table, AmlTable};
+use crate::sdt;
+use crate::sdt::SdtHeader;
+use crate::{Acpi, AcpiError, AcpiHandler, GenericAddress, PhysicalMapping};
 
 /// Represents the Fixed ACPI Description Table (FADT). This table contains various fixed hardware
 /// details, such as the addresses of the hardware register blocks. It also contains a pointer to

+ 2 - 2
src/hpet.rs

@@ -1,5 +1,5 @@
-use sdt::SdtHeader;
-use {AcpiError, GenericAddress, PhysicalMapping};
+use crate::sdt::SdtHeader;
+use crate::{AcpiError, GenericAddress, PhysicalMapping};
 
 #[repr(C, packed)]
 pub struct Hpet {

+ 7 - 7
src/lib.rs

@@ -22,18 +22,18 @@ mod rsdp;
 mod rsdp_search;
 mod sdt;
 
-pub use aml::AmlError;
-pub use madt::MadtError;
-pub use rsdp_search::search_for_rsdp_bios;
+pub use crate::aml::AmlError;
+pub use crate::madt::MadtError;
+pub use crate::rsdp_search::search_for_rsdp_bios;
 
 use alloc::{collections::BTreeMap, string::String, vec::Vec};
-use aml::AmlValue;
+use crate::aml::AmlValue;
 use core::mem;
 use core::ops::Deref;
 use core::ptr::NonNull;
-use interrupt::InterruptModel;
-use rsdp::Rsdp;
-use sdt::SdtHeader;
+use crate::interrupt::InterruptModel;
+use crate::rsdp::Rsdp;
+use crate::sdt::SdtHeader;
 
 #[derive(Debug)]
 // TODO: manually implement Debug to print signatures correctly etc.

+ 5 - 5
src/madt.rs

@@ -2,11 +2,11 @@ use alloc::vec::Vec;
 use bit_field::BitField;
 use core::marker::PhantomData;
 use core::mem;
-use interrupt::{
+use crate::interrupt::{
     InterruptModel, InterruptSourceOverride, IoApic, NmiSource, Polarity, TriggerMode,
 };
-use sdt::SdtHeader;
-use {Acpi, AcpiError, AcpiHandler, PhysicalMapping, Processor, ProcessorState};
+use crate::sdt::SdtHeader;
+use crate::{Acpi, AcpiError, AcpiHandler, PhysicalMapping, Processor, ProcessorState};
 
 #[derive(Debug)]
 pub enum MadtError {
@@ -328,7 +328,7 @@ struct GicInterruptTranslationServiceEntry {
 
 pub(crate) fn parse_madt<H>(
     acpi: &mut Acpi,
-    handler: &mut H,
+    _handler: &mut H,
     mapping: &PhysicalMapping<Madt>,
 ) -> Result<(), AcpiError>
 where
@@ -390,7 +390,7 @@ fn parse_apic_model(
     acpi: &mut Acpi,
     mapping: &PhysicalMapping<Madt>,
 ) -> Result<InterruptModel, AcpiError> {
-    use interrupt::LocalInterruptLine;
+    use crate::interrupt::LocalInterruptLine;
 
     let mut local_apic_address = (*mapping).local_apic_address as u64;
     let mut io_apics = Vec::new();

+ 3 - 3
src/rsdp_search.rs

@@ -1,7 +1,7 @@
 use core::{mem, ops::RangeInclusive};
-use rsdp::Rsdp;
-use Acpi;
-use {parse_validated_rsdp, AcpiError, AcpiHandler};
+use crate::rsdp::Rsdp;
+use crate::Acpi;
+use crate::{parse_validated_rsdp, AcpiError, AcpiHandler};
 
 /// The pointer to the EBDA (Extended Bios Data Area) start segment pointer
 const EBDA_START_SEGMENT_PTR: usize = 0x40e;

+ 7 - 7
src/sdt.rs

@@ -1,8 +1,8 @@
 use core::{mem, str};
-use fadt::Fadt;
-use hpet::Hpet;
-use madt::Madt;
-use {Acpi, AcpiError, AcpiHandler};
+use crate::fadt::Fadt;
+use crate::hpet::Hpet;
+use crate::madt::Madt;
+use crate::{Acpi, AcpiError, AcpiHandler};
 
 /// All SDTs share the same header, and are `length` bytes long. The signature tells us which SDT
 /// this is.
@@ -154,21 +154,21 @@ where
         "FACP" => {
             let fadt_mapping =
                 handler.map_physical_region::<Fadt>(physical_address, mem::size_of::<Fadt>());
-            ::fadt::parse_fadt(acpi, handler, &fadt_mapping)?;
+            crate::fadt::parse_fadt(acpi, handler, &fadt_mapping)?;
             handler.unmap_physical_region(fadt_mapping);
         }
 
         "HPET" => {
             let hpet_mapping =
                 handler.map_physical_region::<Hpet>(physical_address, mem::size_of::<Hpet>());
-            ::hpet::parse_hpet(&hpet_mapping)?;
+            crate::hpet::parse_hpet(&hpet_mapping)?;
             handler.unmap_physical_region(hpet_mapping);
         }
 
         "APIC" => {
             let madt_mapping =
                 handler.map_physical_region::<Madt>(physical_address, header.length() as usize);
-            ::madt::parse_madt(acpi, handler, &madt_mapping)?;
+            crate::madt::parse_madt(acpi, handler, &madt_mapping)?;
             handler.unmap_physical_region(madt_mapping);
         }