jayber d36d7b32e5 feat: added closures exercises in closure directory
Closures as a separate exercises appeared to be missing, so I added some. Have placed them in the watch order after functions, which seemed reasonable.
2022-05-31 14:00:50 +01:00

21 lines
400 B
Rust

// closures1.rs
// Closures are anonymous functions, but they can be assigned to a variable
// so that they can be used later on.
// make me compile and pass
// Execute `rustlings hint closures1` for hints!
// I AM NOT DONE
fn main() {}
#[cfg(test)]
mod tests {
use super::*;
# [test]
fn test_closure() {
let closure = ;
assert_eq!("I'm a closure",closure());
}
}