pub fn symbol_lookup(name: &str) -> Option<String> {
    let symbols = File::open("/proc/kallsyms");
    if symbols.is_err() {
        return None;
    }

    let symbols = BufReader::new(symbols.unwrap());

    for line in symbols.lines() {
        let line = line.unwrap();
        let parts: Vec<&str> = line.split_whitespace().collect();
        if parts.get(2) == Some(&name) {
            return Some(parts[0].to_string());
        }
    }

    None
}
// TODO: a result is probably more appropriate
a result is probably more appropriate
a result is probably more appropriate
pub fn symbol_lookup(name: &str) -> Option<String> {
    let symbols = File::open("/proc/kallsyms");
    if symbols.is_err() {
        return None;
    }
    let symbols = BufReader::new(symbols.unwrap());
    for line in symbols.lines() {
        let line = line.unwrap();
        let parts: Vec<&str> = line.split_whitespace().collect();
        if parts.get(2) == Some(&name) {
            return Some(parts[0].to_string());
        }
    }
    None
}
pub fn symbol_lookup ( name : & str ) -> Option < String > { let symbols = File :: open ( " " ) ; if symbols . is_err ( ) { return None ; } let symbols = BufReader :: new ( symbols . unwrap ( ) ) ; for line in symbols . lines ( ) { let line = line . unwrap ( ) ; let parts : Vec < & str > = line . split_whitespace ( ) . collect ( ) ; if parts . get ( 2 ) == Some ( & name ) { return Some ( parts [ 0 ] . to_string ( ) ) ; } } None }
TODO: a result is probably more appropriate
TODO : a result is probably more appropriate
name
&str