We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Diff::actual_file
1 parent 90fec5a commit 1551fd1Copy full SHA for 1551fd1
src/tools/run-make-support/src/diff/mod.rs
@@ -51,7 +51,10 @@ impl Diff {
51
/// Specify the actual output for the diff from a file.
52
pub fn actual_file<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
53
let path = path.as_ref();
54
- let content = std::fs::read_to_string(path).expect("failed to read file");
+ let content = match std::fs::read_to_string(path) {
55
+ Ok(c) => c,
56
+ Err(e) => panic!("failed to read `{}`: {:?}", path.display(), e),
57
+ };
58
let name = path.to_string_lossy().to_string();
59
60
self.actual = Some(content);
0 commit comments