Maps
type Routes map[str]fn()
fn main() { let routes = Routes{ "+" => () => println("add") "-" => () => println("sub") } routes["+"]()}Map keys and values are explicitly typed in map[K]V.
type Routes map[str]fn()
fn main() { let routes = Routes{ "+" => () => println("add") "-" => () => println("sub") } routes["+"]()}Map keys and values are explicitly typed in map[K]V.