From cc4b819d6bc22bf375524dfaa96183e424e294c4 Mon Sep 17 00:00:00 2001 From: jn Date: Fri, 20 Jan 2023 15:30:16 +0100 Subject: [PATCH] Include filename in error message when #include fails --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 55459a1..b834ba2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -481,7 +481,7 @@ fn include_text_file(line_number: usize, text: &str, input_file: String) -> Stri } } - let mut included_file = read_to_string(source_path).expect("failed to include file"); + let mut included_file = read_to_string(source_path).expect(&format!("failed to include file \"{}\"", path_string)); included_file.push('\n'); let mut end_of_original_file = String::new();