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

deps: update some minor dependency versions #1087

Merged
merged 2 commits into from
Apr 7, 2023
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
109 changes: 83 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@ log = { version = "0.4.17", optional = true }
nvml-wrapper = { version = "0.9.0", optional = true }
once_cell = "1.5.2"
regex = "1.7.3"
serde = { version = "1.0.158", features = ["derive"] }
serde = { version = "1.0.159", features = ["derive"] }
starship-battery = { version = "0.7.9", optional = true }
sysinfo = "0.28.4"
thiserror = "1.0.40"
time = { version = "0.3.20", features = ["formatting", "macros"] }
toml_edit = { version = "0.19.8", features = ["serde"] }
tui = "0.19.0"
typed-builder = "0.10.0"
typed-builder = "0.14.0"
unicode-segmentation = "1.10.1"
unicode-width = "0.1.10"

[target.'cfg(unix)'.dependencies]
libc = "0.2.140"
libc = "0.2.141"

[target.'cfg(target_os = "linux")'.dependencies]
heim = { version = "0.1.0-rc.1", features = ["disk"] }
Expand All @@ -118,7 +118,7 @@ mach2 = "0.4.1"

[target.'cfg(target_os = "windows")'.dependencies]
heim = { version = "0.1.0-rc.1", features = ["disk"] }
windows = { version = "0.46.0", features = [
windows = { version = "0.48.0", features = [
"Win32_Foundation",
"Win32_System_ProcessStatus",
"Win32_System_Threading",
Expand Down
6 changes: 2 additions & 4 deletions src/app/data_harvester/memory/windows.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::mem::{size_of, zeroed};
use windows::Win32::Foundation::TRUE;
use windows::Win32::System::ProcessStatus::{K32GetPerformanceInfo, PERFORMANCE_INFORMATION};
use windows::Win32::System::ProcessStatus::{GetPerformanceInfo, PERFORMANCE_INFORMATION};

use crate::data_harvester::memory::MemHarvest;

Expand All @@ -13,9 +13,7 @@ pub(crate) fn get_swap_usage() -> Option<MemHarvest> {
// the bindings are "safe" to use with how we call them.
unsafe {
let mut perf_info: PERFORMANCE_INFORMATION = zeroed();
if K32GetPerformanceInfo(&mut perf_info, size_of::<PERFORMANCE_INFORMATION>() as u32)
== TRUE
{
if GetPerformanceInfo(&mut perf_info, size_of::<PERFORMANCE_INFORMATION>() as u32) == TRUE {
// Saturating sub by perf_info.PhysicalTotal for what sysinfo does.
let swap_total = perf_info.PageSize.saturating_mul(perf_info.CommitLimit) as u64;
let swap_used = perf_info.PageSize.saturating_mul(perf_info.CommitTotal) as u64;
Expand Down