From cd14e3d7d057fe26db5aad2060930a2e7874bd78 Mon Sep 17 00:00:00 2001 From: mosure Date: Mon, 4 Dec 2023 10:07:56 -0600 Subject: [PATCH] chore: update byte_unit --- Cargo.toml | 2 +- tools/ply_to_gcloud.rs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e2b75224..4a67c165 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ io_ply = ["ply-rs"] bevy-inspector-egui = "0.21" bevy_panorbit_camera = "0.9" bincode2 = { version = "2.0", optional = true } -byte-unit = "4.0" +byte-unit = "5.0.3" bytemuck = "1.14" flate2 = { version = "1.0", optional = true } flexbuffers = { version = "2.0", optional = true } diff --git a/tools/ply_to_gcloud.rs b/tools/ply_to_gcloud.rs index 11c381d1..3f3cbedd 100644 --- a/tools/ply_to_gcloud.rs +++ b/tools/ply_to_gcloud.rs @@ -1,6 +1,9 @@ use std::io::Write; -use byte_unit::Byte; +use byte_unit::{ + Byte, + UnitType, +}; use bevy_gaussian_splatting::{ GaussianCloud, @@ -33,6 +36,6 @@ fn main() { let data = cloud.encode(); gcloud_writer.write_all(data.as_slice()).expect("failed to write to gcloud file"); - let post_encode_bytes = Byte::from_bytes(std::fs::metadata(&gcloud_filename).expect("failed to get metadata").len() as u128); - println!("output file size: {}", post_encode_bytes.get_appropriate_unit(true).to_string()); + let post_encode_bytes = Byte::from_u64(std::fs::metadata(&gcloud_filename).expect("failed to get metadata").len()); + println!("output file size: {}", post_encode_bytes.get_appropriate_unit(UnitType::Decimal).to_string()); }