From cbc9e01902344ac753a646e9f3f31ac9cb650cbb Mon Sep 17 00:00:00 2001 From: Christopher Serr Date: Thu, 15 Aug 2024 17:19:08 +0200 Subject: [PATCH] Update more dependencies --- crates/livesplit-auto-splitting/Cargo.toml | 5 +++-- crates/livesplit-auto-splitting/src/runtime/mod.rs | 14 +++++++++----- crates/livesplit-hotkey/Cargo.toml | 6 +++--- crates/livesplit-hotkey/src/windows/mod.rs | 6 +++--- src/rendering/svg.rs | 7 ++----- src/run/parser/flitter/s_expressions.rs | 2 +- 6 files changed, 21 insertions(+), 19 deletions(-) diff --git a/crates/livesplit-auto-splitting/Cargo.toml b/crates/livesplit-auto-splitting/Cargo.toml index d37a46d8..5b16b357 100644 --- a/crates/livesplit-auto-splitting/Cargo.toml +++ b/crates/livesplit-auto-splitting/Cargo.toml @@ -20,8 +20,9 @@ proc-maps = { version = "0.3.0", default-features = false } read-process-memory = { version = "0.1.4", default-features = false } slotmap = { version = "1.0.2", default-features = false } snafu = "0.8.0" -sysinfo = { version = "0.30.0", default-features = false, features = [ +sysinfo = { version = "0.31.2", default-features = false, features = [ "multithread", + "system", ] } time = { version = "0.3.3", default-features = false } wasmtime = { version = "23.0.0", default-features = false, features = [ @@ -35,7 +36,7 @@ wasmtime-wasi = { version = "23.0.0", default-features = false, features = [ ] } [target.'cfg(windows)'.dependencies] -windows-sys = { version = "0.52.0", features = ["Win32_Storage_FileSystem"] } +windows-sys = { version = "0.59.0", features = ["Win32_Storage_FileSystem"] } [features] default = ["enhanced-backtrace"] diff --git a/crates/livesplit-auto-splitting/src/runtime/mod.rs b/crates/livesplit-auto-splitting/src/runtime/mod.rs index 10ce0916..15dd4e8e 100644 --- a/crates/livesplit-auto-splitting/src/runtime/mod.rs +++ b/crates/livesplit-auto-splitting/src/runtime/mod.rs @@ -15,7 +15,7 @@ use std::{ }, time::{Duration, Instant}, }; -use sysinfo::{ProcessRefreshKind, RefreshKind, System, UpdateKind}; +use sysinfo::{ProcessRefreshKind, ProcessesToUpdate, RefreshKind, System, UpdateKind}; use wasmtime::{ Engine, Extern, Linker, Memory, Module, OptLevel, Store, TypedFunc, WasmBacktraceDetails, }; @@ -121,19 +121,23 @@ impl ProcessList { let now = Instant::now(); if now >= self.next_check { self.system - .refresh_processes_specifics(multiple_processes()); + .refresh_processes_specifics(ProcessesToUpdate::All, multiple_processes()); self.next_check = now + Duration::from_secs(1); } } pub fn refresh_single_process(&mut self, pid: sysinfo::Pid) { - if !self.system.refresh_process_specifics(pid, single_process()) { + if self + .system + .refresh_processes_specifics(ProcessesToUpdate::Some(&[pid]), single_process()) + != 0 + { // FIXME: Unfortunately `refresh_process_specifics` doesn't remove // the process if it doesn't exist anymore. There also doesn't seem // to be a way to manually remove it. So we have to do a full // refresh of all processes. self.system - .refresh_processes_specifics(multiple_processes()); + .refresh_processes_specifics(ProcessesToUpdate::All, multiple_processes()); self.next_check = Instant::now() + Duration::from_secs(1); } } @@ -156,7 +160,7 @@ impl ProcessList { self.system .processes() .values() - .filter(move |p| p.name().as_bytes() == name) + .filter(move |p| p.name().as_encoded_bytes() == name) } pub fn is_open(&self, pid: sysinfo::Pid) -> bool { diff --git a/crates/livesplit-hotkey/Cargo.toml b/crates/livesplit-hotkey/Cargo.toml index b4654987..8dcddefe 100644 --- a/crates/livesplit-hotkey/Cargo.toml +++ b/crates/livesplit-hotkey/Cargo.toml @@ -11,7 +11,7 @@ edition = "2021" rust-version = "1.73" [target.'cfg(windows)'.dependencies] -windows-sys = { version = "0.52.0", features = [ +windows-sys = { version = "0.59.0", features = [ "Win32_Foundation", "Win32_System_LibraryLoader", "Win32_System_Threading", @@ -22,11 +22,11 @@ windows-sys = { version = "0.52.0", features = [ [target.'cfg(target_os = "linux")'.dependencies] crossbeam-channel = { version = "0.5.6", optional = true } evdev = { version = "0.12.1", optional = true } -mio = { version = "0.8.0", default-features = false, features = [ +mio = { version = "1.0.2", default-features = false, features = [ "os-ext", "os-poll", ], optional = true } -nix = { version = "0.28.0", features = ["user"], optional = true } +nix = { version = "0.29.0", features = ["user"], optional = true } promising-future = { version = "0.2.4", optional = true } x11-dl = { version = "2.20.0", optional = true } diff --git a/crates/livesplit-hotkey/src/windows/mod.rs b/crates/livesplit-hotkey/src/windows/mod.rs index 7d96bdf1..67fc59d8 100644 --- a/crates/livesplit-hotkey/src/windows/mod.rs +++ b/crates/livesplit-hotkey/src/windows/mod.rs @@ -389,7 +389,7 @@ impl Hook { let (events_tx, events_rx) = channel(); thread::spawn(move || { - let mut hook = 0; + let mut hook = ptr::null_mut(); STATE.with(|state| { hook = unsafe { @@ -401,7 +401,7 @@ impl Hook { ) }; - if hook != 0 { + if !hook.is_null() { initialized_tx .send(Ok(unsafe { GetCurrentThreadId() })) .map_err(|_| Error::ThreadStopped)?; @@ -423,7 +423,7 @@ impl Hook { loop { let mut msg = mem::MaybeUninit::uninit(); - let ret = unsafe { GetMessageW(msg.as_mut_ptr(), 0, 0, 0) }; + let ret = unsafe { GetMessageW(msg.as_mut_ptr(), ptr::null_mut(), 0, 0) }; if ret < 0 { return Err(Error::MessageLoop); } diff --git a/src/rendering/svg.rs b/src/rendering/svg.rs index 8915a690..04d87bfa 100644 --- a/src/rendering/svg.rs +++ b/src/rendering/svg.rs @@ -102,10 +102,7 @@ impl Renderer { Ok(new_dims) } - fn write_defs( - &mut self, - writer: &mut Writer, - ) -> Result, fmt::Error> { + fn write_defs(&self, writer: &mut Writer) -> Result, fmt::Error> { let current_id = &mut 0; let mut background_filter_id = None; @@ -195,7 +192,7 @@ impl Renderer { } fn write_scene( - &mut self, + &self, writer: &mut Writer, width: f32, height: f32, diff --git a/src/run/parser/flitter/s_expressions.rs b/src/run/parser/flitter/s_expressions.rs index 47e97cd1..8d6be9f3 100644 --- a/src/run/parser/flitter/s_expressions.rs +++ b/src/run/parser/flitter/s_expressions.rs @@ -69,7 +69,7 @@ impl<'source> Deserializer<'source> { self.source = self.source.trim_start(); } - fn starts_with(&mut self, c: char) -> bool { + fn starts_with(&self, c: char) -> bool { self.source.starts_with(c) }