getopts: format failure messages with Show.
This obsoletes the old `to_err_msg` method. Replace
println!("Error: {}", failure.to_err_msg())
let string = failure.to_err_msg();
with
println!("Error: {}", failure)
let string = failure.to_str();
[breaking-change]
This commit is contained in:
parent
3851d68a27
commit
0642cbbde0
7 changed files with 28 additions and 21 deletions
|
|
@ -20,7 +20,7 @@ pub fn main() {
|
|||
match getopts(args.as_slice(), opts.as_slice()) {
|
||||
Ok(ref m) =>
|
||||
assert!(!m.opt_present("b")),
|
||||
Err(ref f) => fail!("{:?}", (*f).clone().to_err_msg())
|
||||
Err(ref f) => fail!("{}", *f)
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue