-
-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: cargo clippy warning and error #1274
Conversation
src/c_interface.rs
Outdated
@@ -108,7 +108,7 @@ pub extern "C" fn sysinfo_refresh_process(system: CSystem, pid: PID) { | |||
let mut system: Box<System> = Box::from_raw(system as *mut System); | |||
{ | |||
let system: &mut System = system.borrow_mut(); | |||
system.refresh_process(Pid(pid)); | |||
system.refresh_process(Pid(pid.try_into().unwrap())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For all these cases, as _
should be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, resubmitted.
@@ -586,55 +590,49 @@ pub extern "C" fn sysinfo_cpu_frequency(system: CSystem) -> u64 { | |||
/// Equivalent of [`System::name()`][crate::System#method.name]. | |||
#[no_mangle] | |||
pub extern "C" fn sysinfo_system_name() -> RString { | |||
let c_string = if let Some(c) = System::name().and_then(|p| CString::new(p).ok()) { | |||
if let Some(c) = System::name().and_then(|p| CString::new(p).ok()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 👍
Please run |
Thanks! |
clippy tips:
and :