Byte to u64
Some checks failed
Rust / build (push) Failing after 1m20s

This commit is contained in:
PurpleCow 2025-05-22 02:36:06 +02:00
parent 201a936b4b
commit 0c13a7b258

View File

@ -60,14 +60,14 @@ pub fn get_storage_devices(allow_non_removable: bool) -> anyhow::Result<Vec<Devi
vendor: fs::read_to_string(entry.path().join("device/vendor")) vendor: fs::read_to_string(entry.path().join("device/vendor"))
.map(trimmed) .map(trimmed)
.context("Error querying storage devices")?, .context("Error querying storage devices")?,
size: Byte::from_u128( size: Byte::from_u64(
fs::read_to_string(entry.path().join("size")) fs::read_to_string(entry.path().join("size"))
.context("Error querying storage devices")? .context("Error querying storage devices")?
.trim() .trim()
.parse::<u128>() .parse::<u64>()
.context("Could not parse block size to unsigned integer (u128)")? .context("Could not parse block size to unsigned integer (u128)")?
* 512, * 512,
).expect("Invalid byte size"), ),
}); });
} }