Created
April 5, 2019 20:54
-
-
Save silphire/b6470992bca6d1aaba39ed061ff15e09 to your computer and use it in GitHub Desktop.
I don't know why function type cannot be used as a type parameter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::HashMap; | |
use std::any::Any; | |
fn main() { | |
let funcs: Option<HashMap<isize, &Any>> = Some(HashMap::new()); | |
// expected expression, found keyword `fn` | |
let func = funcs.map(|v| (*v.get(0)).downcast_ref<fn(n: isize)>()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment