Skip to content

Commit a0cf32a

Browse files
committed
Update sysinfo to 0.33
to fix windows build
1 parent a360249 commit a0cf32a

File tree

4 files changed

+140
-32
lines changed

4 files changed

+140
-32
lines changed

Cargo.lock

Lines changed: 136 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ toml_edit = "0.21.*"
1818
shellexpand = "2.1.*"
1919
log = "0.4.*"
2020
env_logger = "0.10.*"
21-
sysinfo = "0.22.*"
21+
sysinfo = "0.33.*"
2222

2323
[package.metadata.deb]
2424
maintainer = "beeender <chenmulong@gmail.com>"

src/backend/alacritty.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
use super::Functions;
22
use crate::config::Config;
33
use crate::error::GlrnvimError;
4-
use std::ffi::OsStr;
54
use std::fs;
65
use std::path::Path;
76
use std::path::PathBuf;
87
use std::{thread, time};
9-
use sysinfo::{Pid, ProcessExt, Signal, System, SystemExt};
8+
use sysinfo::{Pid, Signal, System};
109
use tempfile::NamedTempFile;
1110
extern crate log;
1211
use toml_edit::{value, Document, Item, Table, Value};
@@ -149,7 +148,6 @@ impl Functions for Alacritty {
149148
fn post_start(&mut self, config: &Config, term_pid: Pid) {
150149
let proc_name = match Path::new(&config.nvim_exe_path)
151150
.file_name()
152-
.and_then(OsStr::to_str)
153151
{
154152
None => {
155153
log::warn!(
@@ -166,7 +164,7 @@ impl Functions for Alacritty {
166164
loop {
167165
count += 1;
168166
let s = System::new_all();
169-
for process in s.process_by_name(proc_name) {
167+
for process in s.processes_by_name(proc_name) {
170168
match process.parent() {
171169
None => {}
172170
Some(ppid) => {

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
160160
log::debug!("Start command: {:?}", command);
161161
let mut child = command.spawn()?;
162162

163-
backend_functions.post_start(&config, child.id() as Pid);
163+
backend_functions.post_start(&config, Pid::from_u32(child.id()));
164164

165165
if config.fork {
166166
std::process::exit(0);

0 commit comments

Comments
 (0)