Created
December 1, 2022 14:44
-
-
Save RGGH/0de3e6e91d416de9d17c67d6ed6bf608 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::fs; | |
fn main() { | |
let results = fs::read_to_string("mytext.txt"); | |
let contents = match results { | |
Ok(messag) => messag, | |
Err(error) => String::from("Uh oh"), | |
}; | |
println!("{}", contents); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Read text file with rust