Skip to content

Commit 40e0232

Browse files
authored
Fix machine fingerprint byte size output (#283)
Stumbled into this while exploring the cli options, was outputting that my machine had multiple TiB of RAM. The version bump isn't necessary but I noticed it was there while looking at the docs.
1 parent 337d047 commit 40e0232

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

Cargo.lock

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

crates/fingerprint/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2021"
77

88
[dependencies]
99
anyhow = "1.0"
10-
bytesize = "1.1"
10+
bytesize = "2.0"
1111
hostname = "0.3"
1212
log = "0.4"
1313
os_info = "3.2"

crates/fingerprint/src/machine.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ impl Machine {
5555
// measurement commonly used for memory) but it is unclear whether `sysinfo` is returning KB
5656
// or KiB.
5757
sys.refresh_memory();
58-
let memory_total_kb = sys.total_memory();
59-
let memory = bytesize::to_string(bytesize::ByteSize::kib(memory_total_kb).0, true);
58+
let memory_total_kb = sys.total_memory() / 1024;
59+
let memory = bytesize::ByteSize::kib(memory_total_kb)
60+
.display()
61+
.iec()
62+
.to_string();
6063

6164
// Hash all properties into a unique identifier.
6265
let hash = hash::string(&format!(

0 commit comments

Comments
 (0)