1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// User-defined module: utils // Demonstrates how to create your own modules pub fn double(x: int) -> int { x * 2 } pub fn triple(x: int) -> int { x * 3 } pub fn greet(name: string) -> string { let greeting = "Hello" "${greeting}, ${name}!" }