I implement strtol in Rust like this:
strtol
fn strtol(chars: &mut Chars<\'_>) -> i64 { let mut result: i64 = 0; loop { match c