1
0
mirror of https://github.com/jht5945/rust_util.git synced 2025-12-29 08:30:04 +08:00

fix parse_size

This commit is contained in:
2019-07-22 01:30:23 +08:00
parent 68e7818c27
commit 2b1c7ca310

View File

@@ -171,7 +171,7 @@ pub fn parse_size(size: &str) -> XResult<i64> {
return Ok((SIZE_PB as f64 * no_last_b_size[0..no_last_b_size.len()-1].parse::<f64>()?) as i64); return Ok((SIZE_PB as f64 * no_last_b_size[0..no_last_b_size.len()-1].parse::<f64>()?) as i64);
} }
Err(new_box_error(&format!("Cannot parse size: {}", size))) Ok(no_last_b_size.parse::<i64>()?)
} }
pub fn get_display_size(size: i64) -> String { pub fn get_display_size(size: i64) -> String {