Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn add_one(x: i32) -> i32 {
- return x + 1;
- }
- fn main() {
- let f: fn(i32) -> i32 = add_one;
- assert_eq!(f(5), 6);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement