From the course: Rust Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Challenge: Check the roster

Challenge: Check the roster - Rust Tutorial

From the course: Rust Essential Training

Start my 1-month free trial

Challenge: Check the roster

- [Narrator] I think it's about time for another challenge. To practice File IO and using command line arguments. Your goal is to write a program to check a text file containing a list of names that determine if a specific person is on the roster. Then display a message to indicate whether or not their name was found on the list. Your program should except two input command line arguments. The path to a text file containing the list of names. And the name you want to search for. Calling your program from the command line would look something like this. To check if the name Stone is contained within roster.txt. Or if you run it with Cargo, passing those two input arguments will look like this. To test your program I've included this file moonwalkers.txt which lists the 12 astronauts that have walked on the moon as of 2020. I look forward to this list getting longer in the future. Take some time to develop your solution. Then…

Contents