From ffb1994a59633f438ec835e43aad853a4eb21cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Sat, 31 Dec 2022 10:21:38 +0100 Subject: [PATCH] Main - expect(&format!()) is bad, according to clippy --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index ecd5cd6..08cc498 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,7 +58,8 @@ fn run_prompt() { /// Load a file and run the script it contains. fn run_file(file: &str) -> ErrorHandler { - let contents = fs::read_to_string(file).expect(&format!("Could not load {}", file)); + let contents = fs::read_to_string(file) + .unwrap_or_else(|_| panic!("Could not load {}", file)); run(contents) }