Skip to content

Commit

Permalink
chore: update byte_unit
Browse files Browse the repository at this point in the history
  • Loading branch information
mosure committed Dec 4, 2023
1 parent 70ef895 commit cd14e3d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
9 changes: 6 additions & 3 deletions tools/ply_to_gcloud.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use std::io::Write;

use byte_unit::Byte;
use byte_unit::{
Byte,
UnitType,
};

use bevy_gaussian_splatting::{
GaussianCloud,
Expand Down Expand Up @@ -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());
}

0 comments on commit cd14e3d

Please sign in to comment.