Example usage:
File found example:
use file_reader::read_in;
read_in(Some(String::from("helloworld.txt")));
read_in(None); // defaults to helloworld.txt
My path is helloworld.txt.
Hello world
File not found example:
use file_reader::read_in;
read_in(Some(String::from("nosuchfile.txt")));
My path is nosuchfile.txt.
thread 'main' panicked at src/main.rs:16:21:
File nosuchfile.txt not found: No such file or directory (os error 2)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Adapted from # Coursera Course - Rust Fundamentals
💡 Are you just looking for a 👉 Rust template to get started easily with a project? The template has everything you need!
This repository is Codespaces ready, and it is set as a template repository. You can create a new repository from this template and start working on your own with Codespaces. This means that Rust, Copilot, and all the extensions are already installed and configured for you.
🔥 If you need a quick reference for Codespaces and configuration with Visual Studio Code, feel free to reuse the configuration files in this repository.
- Rust on Visual Studio Code
- Install Rust on Windows
- RustUp the toolchaing installer
- Rust Analyzer extension
- GitHub Copilot
- Copilot for Students and Educators
- Introduction to GitHub Copilot
- Introduction to Codespaces
- Codespaces for students
- Managing quotas
Coursera Courses