mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
aarch64: Address Rust 1.51.0 clippy issue (from_over_into)
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true Error: --> devices/src/legacy/rtc_pl031.rs:73:1 | 73 | impl Into<libc::clockid_t> for ClockType { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D clippy::from-over-into` implied by `-D warnings` = help: consider to implement `From` instead = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
3671f5e94c
commit
4da6bcd5d5
@ -70,9 +70,9 @@ pub enum ClockType {
|
||||
ThreadCpu,
|
||||
}
|
||||
|
||||
impl Into<libc::clockid_t> for ClockType {
|
||||
fn into(self) -> libc::clockid_t {
|
||||
match self {
|
||||
impl From<ClockType> for libc::clockid_t {
|
||||
fn from(ct: ClockType) -> libc::clockid_t {
|
||||
match ct {
|
||||
ClockType::Monotonic => libc::CLOCK_MONOTONIC,
|
||||
ClockType::Real => libc::CLOCK_REALTIME,
|
||||
ClockType::ProcessCpu => libc::CLOCK_PROCESS_CPUTIME_ID,
|
||||
|
Loading…
Reference in New Issue
Block a user