Skip to content

Commit 1043543

Browse files
committed
Fixed cast_lossless clippy warnings
1 parent b1a4aea commit 1043543

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

vm/src/stdlib/os.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use super::super::vm::VirtualMachine;
1818
pub fn raw_file_number(handle: File) -> i64 {
1919
use std::os::unix::io::IntoRawFd;
2020

21-
handle.into_raw_fd() as i64
21+
i64::from(handle.into_raw_fd())
2222
}
2323

2424
#[cfg(target_family = "unix")]

vm/src/stdlib/pystruct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ fn unpack_u64(vm: &mut VirtualMachine, rdr: &mut Read) -> PyResult {
287287
fn unpack_f32(vm: &mut VirtualMachine, rdr: &mut Read) -> PyResult {
288288
match rdr.read_f32::<LittleEndian>() {
289289
Err(err) => panic!("Error in reading {:?}", err),
290-
Ok(v) => Ok(vm.ctx.new_float(v as f64)),
290+
Ok(v) => Ok(vm.ctx.new_float(f64::from(v))),
291291
}
292292
}
293293

vm/src/stdlib/time_module.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn time_sleep(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
1717
}
1818

1919
fn duration_to_f64(d: Duration) -> f64 {
20-
(d.as_secs() as f64) + ((d.subsec_nanos() as f64) / 1e9)
20+
(d.as_secs() as f64) + (f64::from(d.subsec_nanos()) / 1e9)
2121
}
2222

2323
fn time_time(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {

0 commit comments

Comments
 (0)