Rustlings functions1: Declaring your first function

Chris Biscardi
InstructorChris Biscardi

Social Share Links

Tweet

README for this exercise.

Chris Biscardi: [0:00] 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.

[0:16] 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.