Use std::fs::read_to_string to load a file's contents into a String and handle errors with unwrap_or_else.
use std::fs;
fn main() {
let contents = fs::read_to_string("hello.txt")
.unwrap_or_else(|error| {
eprintln!("Problem reading file: {error}");
String::new()
});
println!("{contents}");
}