Update for latest Rust by explicit casting functions to function pointers