mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
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:
parent
99a98f270d
commit
5b51024ef7
@ -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,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user