Skip to main content

parse_size

Function parse_size 

Source
pub fn parse_size(size_str: &str) -> Result<u64>
Expand description

§parse_size - The Universal Translator for Sizes

This handy function takes something a human understands, like “2.5M”, and translates it into something a computer understands (2,621,440 bytes). It’s like having a Babel fish for file sizes. Why should we have to do that math when the computer can do it for us?