deserialize-file-size
A serde helper function for deserializing file size input flexibly and robustly.
Accepts either:
- a "human" size string, e.g. "1k", "5mb", "12GiB", etc.
- an integer number of bytes
Example
use Deserialize;
use deserialize_file_size;
let size_str = r#"{"sz": "42mb"}"#;
assert_eq!;
let int_bytes = r#"{"sz": 4096}"#;
assert_eq!;