Skip to content
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

Update more dependencies #834

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions crates/livesplit-auto-splitting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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"]
Expand Down
14 changes: 9 additions & 5 deletions crates/livesplit-auto-splitting/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -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);
}
}
Expand All @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions crates/livesplit-hotkey/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 }

Expand Down
6 changes: 3 additions & 3 deletions crates/livesplit-hotkey/src/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -401,7 +401,7 @@ impl Hook {
)
};

if hook != 0 {
if !hook.is_null() {
initialized_tx
.send(Ok(unsafe { GetCurrentThreadId() }))
.map_err(|_| Error::ThreadStopped)?;
Expand All @@ -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);
}
Expand Down
7 changes: 2 additions & 5 deletions src/rendering/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ impl Renderer {
Ok(new_dims)
}

fn write_defs<W: Write>(
&mut self,
writer: &mut Writer<W>,
) -> Result<Option<usize>, fmt::Error> {
fn write_defs<W: Write>(&self, writer: &mut Writer<W>) -> Result<Option<usize>, fmt::Error> {
let current_id = &mut 0;
let mut background_filter_id = None;

Expand Down Expand Up @@ -195,7 +192,7 @@ impl Renderer {
}

fn write_scene<W: Write>(
&mut self,
&self,
writer: &mut Writer<W>,
width: f32,
height: f32,
Expand Down
2 changes: 1 addition & 1 deletion src/run/parser/flitter/s_expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
Loading