pci: Remove "from_over_into" clippy

According the std docs implementing From<..> is preferred since it
gives you Into<..> for free where the reverse isn’t true.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@intel.com>
This commit is contained in:
Ravi kumar Veeramally 2023-06-26 17:48:25 +03:00 committed by Bo Chen
parent 99a98f270d
commit 5b51024ef7

View File

@ -452,10 +452,9 @@ impl From<PciBarType> for PciBarRegionType {
} }
} }
#[allow(clippy::from_over_into)] impl From<PciBarRegionType> for PciBarType {
impl Into<PciBarType> for PciBarRegionType { fn from(val: PciBarRegionType) -> Self {
fn into(self) -> PciBarType { match val {
match self {
PciBarRegionType::IoRegion => PciBarType::Io, PciBarRegionType::IoRegion => PciBarType::Io,
PciBarRegionType::Memory32BitRegion => PciBarType::Mmio32, PciBarRegionType::Memory32BitRegion => PciBarType::Mmio32,
PciBarRegionType::Memory64BitRegion => PciBarType::Mmio64, PciBarRegionType::Memory64BitRegion => PciBarType::Mmio64,
@ -469,10 +468,9 @@ pub enum PciBarPrefetchable {
Prefetchable = 0x08, Prefetchable = 0x08,
} }
#[allow(clippy::from_over_into)] impl From<PciBarPrefetchable> for bool {
impl Into<bool> for PciBarPrefetchable { fn from(val: PciBarPrefetchable) -> Self {
fn into(self) -> bool { match val {
match self {
PciBarPrefetchable::NotPrefetchable => false, PciBarPrefetchable::NotPrefetchable => false,
PciBarPrefetchable::Prefetchable => true, PciBarPrefetchable::Prefetchable => true,
} }