mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-04-24 00:30:29 +02:00
Include input filename in error message.
This commit is contained in:
parent
6bac3aad01
commit
b24b5b02f3
@ -42,9 +42,9 @@ fn main() -> anyhow::Result<()> {
|
|||||||
format!("Failed to create output directory {:?}", output_directory)
|
format!("Failed to create output directory {:?}", output_directory)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let input_directory = input_filename
|
let input_directory = input_filename.parent().with_context(|| {
|
||||||
.parent()
|
format!("Input file {:?} has no parent directory.", input_filename)
|
||||||
.with_context(|| "Input file has no parent directory.")?;
|
})?;
|
||||||
let input_contents = read_to_string(input_filename)
|
let input_contents = read_to_string(input_filename)
|
||||||
.with_context(|| format!("Failed to open {:?}", input_filename))?;
|
.with_context(|| format!("Failed to open {:?}", input_filename))?;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user