You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: file_size.rs
    path of file: ./repos/broot/src/conf
    
    the code of the file until where you have to start completion: use::serde::{
    de,
    Deserialize,
};

pub fn parse_file_size(input: &str) -> Result<u64, String> {
    let s = input.to_lowercase();
    let s = s.trim_end_matches('b');
    let (s, binary) = match s.strip_suffix('i') {
        Some(s) => (s, true),
        None => (s, false),
    };
    let cut = s.find(|c: char| !(c.is_ascii_digit() || c=='.'));
    let (digits, factor): (&str, u64) = match cut {
        Some(idx) => (
            &s[..idx],
            match (&s[idx..], binary) {
                ("k", false) => 1000,
                ("k", true) => 1024,
                ("m", false) => 1000*1000,
                ("m", true) => 1024*1024,
                ("g", false) => 1000*1000*1000,
                ("g", true) => 1024*1024*1024,
                ("t", false) => 1000*1000*1000*1000,
                ("t", true) => 1
    
pub fn parse_file_size(input: &str) -> Result<u64, String> {
    let s = input.to_lowercase();
    let s = s.trim_end_matches('b');
    let (s, binary) = match s.strip_suffix('i') {
        Some(s) => (s, true),
        None => (s, false),
    };
    let cut = s.find(|c: char| !(c.is_ascii_digit() || c=='.'));
    let (digits, factor): (&str, u64) = match cut {
        Some(idx) => (
            &s[..idx],
            match (&s[idx..], binary) {
                ("k", false) => 1000,
                ("k", true) => 1024,
                ("m", false) => 1000*1000,
                ("m", true) => 1024*1024,
                ("g", false) => 1000*1000*1000,
                ("g", true) => 1024*1024*1024,
                ("t", false) => 1000*1000*1000*1000,
                ("t", true) => 1024*1024*1024*1024,
                _ => {
                    // it's not a number
                    return Err(format!("{input:?} can't be parsed as file size"));
                }
            }
        ),
        None => (s, 1),
    };
    match digits.parse::<f64>() {
        Ok(n) => Ok((n * factor as f64).ceil() as u64),
        _ => Err(format!("{input:?} can't be parsed as file size"))
    }
}