Course lesson
Rustlings functions1: Declaring your first function
README for this exercise.
- Duration
- 0 min
- Access
- Free
- Transcript
- Available
README for this exercise.
Course lesson
README for this exercise.
README for this exercise.
Chris Biscardi: In functions1, we have a function called main that calls a function call_me with no arguments. In our error message, we can see that it says, "Cannot find function call_me in this scope." That's because we don't have a function named call_me anywhere. This file is everything that Rust is looking at.
Note that if we copy exactly what we have for main and rename it to call_me with no return value, our tests pass. This is how we declare a function in Rust.
Course lesson
README for this exercise.