Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Rust file reader with panic

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.

Helpful Links

Resources

Coursera Courses

About

Simple File reader app with error handling.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

Generated from JadeCara/rust_setup