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 windows requirement from 0.48.0 to 0.51.0 #26

Merged
merged 2 commits into from
Aug 15, 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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ once_cell = "1.13.1"
procfs = { version = "0.15.1", default-features = false }

[target.'cfg(target_os = "windows")'.dependencies.windows]
version = "0.48.0"
version = "0.51.0"
features = [
"Win32_Foundation",
"Win32_System_Threading",
Expand Down
6 changes: 3 additions & 3 deletions src/collector/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn collect() -> Metrics {
kerneltime.as_mut_ptr(),
usertime.as_mut_ptr(),
);
if ret.as_bool() {
if ret.is_ok() {
// `creationtime` and `_exittime` are points in time expressed as the amount of time that
// has elapsed since midnight on January 1, 1601 in 100 nanosecond time units.
let start_time_seconds =
Expand All @@ -60,7 +60,7 @@ pub fn collect() -> Metrics {
let memcounters = &mut *memcounters;
let cb = size_of::<PROCESS_MEMORY_COUNTERS_EX>();
let ret = GetProcessMemoryInfo(h, memcounters, cb as u32);
if ret.as_bool() {
if ret.is_ok() {
let memcounters = memcounters as *const _ as *const PROCESS_MEMORY_COUNTERS_EX;
let &memcounters = &*memcounters;
(
Expand All @@ -77,7 +77,7 @@ pub fn collect() -> Metrics {
let open_fds = {
let mut handlecount = 0;
let ret = GetProcessHandleCount(h, &mut handlecount);
if ret.as_bool() {
if ret.is_ok() {
Some(handlecount as u64)
} else {
None
Expand Down