Skip to content

Commit

Permalink
Merge pull request #26 from lambdalisue/dependabot/cargo/windows-0.51.0
Browse files Browse the repository at this point in the history
Update windows requirement from 0.48.0 to 0.51.0
  • Loading branch information
lambdalisue authored Aug 15, 2023
2 parents 80548c8 + 1f6e7d1 commit 2d8a767
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 2d8a767

Please sign in to comment.