feat: basic exercise + functions and mods
This commit is contained in:
@@ -91,4 +91,12 @@ pub fn functions_module() {
|
||||
my_point.x += x;
|
||||
my_point.y += y;
|
||||
};
|
||||
|
||||
// Rust provides higher order functions, such as
|
||||
// - map : .map(|n| n * n)
|
||||
// - filter : .filter(|&n| is_add(n))
|
||||
// - take_while : .take_while(|&n| n < upper)
|
||||
|
||||
// Diverging functions
|
||||
// Never return, marked with: !
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user