use Display for errors rather than Debug
This commit is contained in:
parent
b1d83b1d84
commit
45e8925d34
1 changed files with 11 additions and 1 deletions
12
src/main.rs
12
src/main.rs
|
|
@ -2235,7 +2235,7 @@ impl Page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
fn main_inner() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let args: Vec<String> = std::env::args().collect();
|
let args: Vec<String> = std::env::args().collect();
|
||||||
let page_numbers: Option<Box<dyn Iterator<Item = NonZero<u32>>>> = if 2 < args.len() {
|
let page_numbers: Option<Box<dyn Iterator<Item = NonZero<u32>>>> = if 2 < args.len() {
|
||||||
Some(if let Some((start, end)) = args[2].split_once(":") {
|
Some(if let Some((start, end)) = args[2].split_once(":") {
|
||||||
|
|
@ -2277,3 +2277,13 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
std::fs::write("powerisa-instructions.xml", output)?;
|
std::fs::write("powerisa-instructions.xml", output)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn main() -> std::process::ExitCode {
|
||||||
|
match main_inner() {
|
||||||
|
Ok(()) => std::process::ExitCode::SUCCESS,
|
||||||
|
Err(e) => {
|
||||||
|
println!("Error: {e}");
|
||||||
|
std::process::ExitCode::FAILURE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue