From 96c32a70a5d3ade45d9204a2615f0798fd3eca08 Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Sun, 15 Jun 2014 12:50:40 +0200 Subject: [PATCH] remove use of deprecated to_err_msg --- base64/base64.rs | 2 +- basename/basename.rs | 2 +- cat/cat.rs | 2 +- cksum/cksum.rs | 2 +- comm/comm.rs | 2 +- cp/cp.rs | 2 +- dirname/dirname.rs | 2 +- du/du.rs | 2 +- echo/echo.rs | 2 +- factor/factor.rs | 2 +- fold/fold.rs | 2 +- groups/groups.rs | 2 +- hostid/hostid.rs | 2 +- kill/kill.rs | 2 +- logname/logname.rs | 2 +- md5sum/md5sum.rs | 2 +- mkdir/mkdir.rs | 2 +- paste/paste.rs | 2 +- printenv/printenv.rs | 2 +- pwd/pwd.rs | 2 +- rm/rm.rs | 2 +- rmdir/rmdir.rs | 2 +- seq/seq.rs | 2 +- sleep/sleep.rs | 2 +- sum/sum.rs | 2 +- tac/tac.rs | 2 +- tee/tee.rs | 2 +- touch/touch.rs | 2 +- tr/tr.rs | 2 +- truncate/truncate.rs | 2 +- tty/tty.rs | 2 +- uname/uname.rs | 2 +- unlink/unlink.rs | 2 +- uptime/uptime.rs | 2 +- users/users.rs | 2 +- wc/wc.rs | 2 +- whoami/whoami.rs | 2 +- yes/yes.rs | 2 +- 38 files changed, 38 insertions(+), 38 deletions(-) diff --git a/base64/base64.rs b/base64/base64.rs index 91ee7bcbc..e4801dd58 100644 --- a/base64/base64.rs +++ b/base64/base64.rs @@ -48,7 +48,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts(args.tail(), opts) { Ok(m) => m, Err(e) => { - error!("error: {:s}", e.to_err_msg()); + error!("error: {}", e); fail!() } }; diff --git a/basename/basename.rs b/basename/basename.rs index 6fdb51e54..4d0194844 100644 --- a/basename/basename.rs +++ b/basename/basename.rs @@ -39,7 +39,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => crash!(1, "Invalid options\n{}", f.to_err_msg()) + Err(f) => crash!(1, "Invalid options\n{}", f) }; if matches.opt_present("help") { diff --git a/cat/cat.rs b/cat/cat.rs index 79caf0960..b4246afea 100644 --- a/cat/cat.rs +++ b/cat/cat.rs @@ -41,7 +41,7 @@ pub fn uumain(args: Vec) -> int { ]; let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => fail!("Invalid options\n{}", f.to_err_msg()) + Err(f) => fail!("Invalid options\n{}", f) }; if matches.opt_present("help") { println!("cat 1.0.0"); diff --git a/cksum/cksum.rs b/cksum/cksum.rs index 8d1d5cba0..0044e19c5 100644 --- a/cksum/cksum.rs +++ b/cksum/cksum.rs @@ -88,7 +88,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(err) => fail!("{}", err.to_err_msg()), + Err(err) => fail!("{}", err), }; if matches.opt_present("help") { diff --git a/comm/comm.rs b/comm/comm.rs index df5137516..7f0b425c2 100644 --- a/comm/comm.rs +++ b/comm/comm.rs @@ -109,7 +109,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(err) => fail!("{}", err.to_err_msg()), + Err(err) => fail!("{}", err), }; if matches.opt_present("version") { diff --git a/cp/cp.rs b/cp/cp.rs index 66e7ec79a..d0c695a92 100644 --- a/cp/cp.rs +++ b/cp/cp.rs @@ -42,7 +42,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts(args.tail(), opts) { Ok(m) => m, Err(e) => { - error!("error: {:s}", e.to_err_msg()); + error!("error: {}", e); fail!() }, }; diff --git a/dirname/dirname.rs b/dirname/dirname.rs index 3e6714f23..a4f23430b 100644 --- a/dirname/dirname.rs +++ b/dirname/dirname.rs @@ -29,7 +29,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => fail!("Invalid options\n{}", f.to_err_msg()) + Err(f) => fail!("Invalid options\n{}", f) }; if matches.opt_present("help") { diff --git a/du/du.rs b/du/du.rs index 36abca4df..1d252c16f 100644 --- a/du/du.rs +++ b/du/du.rs @@ -162,7 +162,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, Err(f) => { - show_error!("Invalid options\n{}", f.to_err_msg()); + show_error!("Invalid options\n{}", f); return 1; } }; diff --git a/echo/echo.rs b/echo/echo.rs index f8edf5175..a32008127 100644 --- a/echo/echo.rs +++ b/echo/echo.rs @@ -85,7 +85,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => crash!(1, "Invalid options\n{}", f.to_err_msg()) + Err(f) => crash!(1, "Invalid options\n{}", f) }; if matches.opt_present("help") { diff --git a/factor/factor.rs b/factor/factor.rs index fcb87bb95..58389de9d 100644 --- a/factor/factor.rs +++ b/factor/factor.rs @@ -77,7 +77,7 @@ pub fn uumain(args: Vec) { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => crash!(1, "Invalid options\n{}", f.to_err_msg()) + Err(f) => crash!(1, "Invalid options\n{}", f) }; if matches.opt_present("help") { diff --git a/fold/fold.rs b/fold/fold.rs index 711bc879e..f8e8a0e46 100644 --- a/fold/fold.rs +++ b/fold/fold.rs @@ -44,7 +44,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => crash!(1, "{}", f.to_err_msg()) + Err(f) => crash!(1, "{}", f) }; if matches.opt_present("h") { diff --git a/groups/groups.rs b/groups/groups.rs index 2bd8ea8c1..bb1231a5b 100644 --- a/groups/groups.rs +++ b/groups/groups.rs @@ -40,7 +40,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts(args.tail(), options) { Ok(m) => { m }, Err(f) => { - show_error!("{}", f.to_err_msg()); + show_error!("{}", f); return 1; } }; diff --git a/hostid/hostid.rs b/hostid/hostid.rs index f1fa4ce72..0d0d019ea 100644 --- a/hostid/hostid.rs +++ b/hostid/hostid.rs @@ -65,7 +65,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts(args.tail(), opts) { Ok(m) => m, Err(e) => { - show_error!("{}\n{}", e.to_err_msg(), get_help_text(NAME, usage.as_slice())); + show_error!("{}\n{}", e, get_help_text(NAME, usage.as_slice())); return EXIT_ERR; }, }; diff --git a/kill/kill.rs b/kill/kill.rs index 0aa33fd75..67efb4e76 100644 --- a/kill/kill.rs +++ b/kill/kill.rs @@ -71,7 +71,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts(args.tail(), opts) { Ok(m) => m, Err(e) => { - show_error!("{}\n{}", e.to_err_msg(), get_help_text(NAME, usage.as_slice())); + show_error!("{}\n{}", e, get_help_text(NAME, usage.as_slice())); return EXIT_ERR; }, }; diff --git a/logname/logname.rs b/logname/logname.rs index d28dca8f0..edf11a5d9 100644 --- a/logname/logname.rs +++ b/logname/logname.rs @@ -59,7 +59,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => crash!(1, "Invalid options\n{}", f.to_err_msg()) + Err(f) => crash!(1, "Invalid options\n{}", f) }; if matches.opt_present("help") { diff --git a/md5sum/md5sum.rs b/md5sum/md5sum.rs index da4133573..5a6425209 100644 --- a/md5sum/md5sum.rs +++ b/md5sum/md5sum.rs @@ -49,7 +49,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => crash!(1, "{}", f.to_err_msg()) + Err(f) => crash!(1, "{}", f) }; if matches.opt_present("help") { diff --git a/mkdir/mkdir.rs b/mkdir/mkdir.rs index 7dadfa0ce..7e884f3db 100644 --- a/mkdir/mkdir.rs +++ b/mkdir/mkdir.rs @@ -48,7 +48,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, Err(f) => { - crash!(1, "Invalid options\n{}", f.to_err_msg()); + crash!(1, "Invalid options\n{}", f); } }; diff --git a/paste/paste.rs b/paste/paste.rs index 1cc5c3c42..b3241d79a 100644 --- a/paste/paste.rs +++ b/paste/paste.rs @@ -37,7 +37,7 @@ pub fn uumain(args: Vec) -> int { ]; let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => crash!(1, "{}", f.to_err_msg()) + Err(f) => crash!(1, "{}", f) }; if matches.opt_present("help") { println!("{} {}", NAME, VERSION); diff --git a/printenv/printenv.rs b/printenv/printenv.rs index 8eb9cde19..31b93f16b 100644 --- a/printenv/printenv.rs +++ b/printenv/printenv.rs @@ -37,7 +37,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, Err(f) => { - crash!(1, "Invalid options\n{}", f.to_err_msg()) + crash!(1, "Invalid options\n{}", f) } }; if matches.opt_present("help") { diff --git a/pwd/pwd.rs b/pwd/pwd.rs index 7283179c7..adc853dd6 100644 --- a/pwd/pwd.rs +++ b/pwd/pwd.rs @@ -36,7 +36,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, Err(f) => { - crash!(1, "Invalid options\n{}", f.to_err_msg()) + crash!(1, "Invalid options\n{}", f) } }; diff --git a/rm/rm.rs b/rm/rm.rs index f0372391e..72022b197 100644 --- a/rm/rm.rs +++ b/rm/rm.rs @@ -53,7 +53,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, Err(f) => { - crash!(1, "{}", f.to_err_msg()) + crash!(1, "{}", f) } }; if matches.opt_present("help") { diff --git a/rmdir/rmdir.rs b/rmdir/rmdir.rs index d2dcba897..02d1e103c 100644 --- a/rmdir/rmdir.rs +++ b/rmdir/rmdir.rs @@ -38,7 +38,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, Err(f) => { - show_error!("{}", f.to_err_msg()); + show_error!("{}", f); return 1; } }; diff --git a/seq/seq.rs b/seq/seq.rs index 392bef040..c8a642479 100644 --- a/seq/seq.rs +++ b/seq/seq.rs @@ -47,7 +47,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => { m } Err(f) => { - show_error!("{:s}", f.to_err_msg()); + show_error!("{}", f); print_usage(opts); return 1; } diff --git a/sleep/sleep.rs b/sleep/sleep.rs index b67d1ba85..7268e89f5 100644 --- a/sleep/sleep.rs +++ b/sleep/sleep.rs @@ -37,7 +37,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, Err(f) => { - show_error!("{}", f.to_err_msg()); + show_error!("{}", f); return 1; } }; diff --git a/sum/sum.rs b/sum/sum.rs index 177fe7590..048223406 100644 --- a/sum/sum.rs +++ b/sum/sum.rs @@ -90,7 +90,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => crash!(1, "Invalid options\n{}", f.to_err_msg()) + Err(f) => crash!(1, "Invalid options\n{}", f) }; if matches.opt_present("help") { diff --git a/tac/tac.rs b/tac/tac.rs index 30ddfeb20..9af806327 100644 --- a/tac/tac.rs +++ b/tac/tac.rs @@ -38,7 +38,7 @@ pub fn uumain(args: Vec) -> int { ]; let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => crash!(1, "{}", f.to_err_msg()) + Err(f) => crash!(1, "{}", f) }; if matches.opt_present("help") { println!("tac {}", VERSION); diff --git a/tee/tee.rs b/tee/tee.rs index 83fc010e9..503319c77 100644 --- a/tee/tee.rs +++ b/tee/tee.rs @@ -52,7 +52,7 @@ fn options(args: &[String]) -> Result { let args: Vec = args.iter().map(|x| x.to_string()).collect(); - getopts(args.tail(), opts).map_err(|e| e.to_err_msg()).and_then(|m| { + getopts(args.tail(), opts).map_err(|e| format!("{}", e)).and_then(|m| { let version = format!("{} {}", NAME, VERSION); let program = args.get(0).as_slice(); let arguments = "[OPTION]... [FILE]..."; diff --git a/touch/touch.rs b/touch/touch.rs index abe98a39f..6bad044cb 100644 --- a/touch/touch.rs +++ b/touch/touch.rs @@ -44,7 +44,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(e) => fail!("Invalid options\n{}", e.to_err_msg()) + Err(e) => fail!("Invalid options\n{}", e) }; if matches.opt_present("version") { diff --git a/tr/tr.rs b/tr/tr.rs index 03e78f251..eebb89a0a 100644 --- a/tr/tr.rs +++ b/tr/tr.rs @@ -161,7 +161,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, Err(err) => { - show_error!("{}", err.to_err_msg()); + show_error!("{}", err); return 1; } }; diff --git a/truncate/truncate.rs b/truncate/truncate.rs index 1f9f54925..c4c34de9d 100644 --- a/truncate/truncate.rs +++ b/truncate/truncate.rs @@ -51,7 +51,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, Err(f) => { - crash!(1, "{}", f.to_err_msg()) + crash!(1, "{}", f) } }; diff --git a/tty/tty.rs b/tty/tty.rs index 1f10b9c34..92efa31f6 100644 --- a/tty/tty.rs +++ b/tty/tty.rs @@ -47,7 +47,7 @@ pub fn uumain(args: Vec) -> int { m.opt_present("s") }, Err(f) => { - println(f.to_err_msg().as_slice()); + println!("{}", f); usage(); return 2; } diff --git a/uname/uname.rs b/uname/uname.rs index fc4cf3c8b..38984e6c0 100644 --- a/uname/uname.rs +++ b/uname/uname.rs @@ -68,7 +68,7 @@ pub fn uumain(args: Vec) -> int { ]; let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => crash!(1, "{}", f.to_err_msg()), + Err(f) => crash!(1, "{}", f), }; if matches.opt_present("help") { println!("uname 1.0.0"); diff --git a/unlink/unlink.rs b/unlink/unlink.rs index aa07f0930..2f432baaf 100644 --- a/unlink/unlink.rs +++ b/unlink/unlink.rs @@ -39,7 +39,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, Err(f) => { - crash!(1, "invalid options\n{}", f.to_err_msg()) + crash!(1, "invalid options\n{}", f) } }; diff --git a/uptime/uptime.rs b/uptime/uptime.rs index cdee621ec..b2b9f2050 100644 --- a/uptime/uptime.rs +++ b/uptime/uptime.rs @@ -58,7 +58,7 @@ pub fn uumain(args: Vec) -> int { ]; let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => crash!(1, "Invalid options\n{}", f.to_err_msg()) + Err(f) => crash!(1, "Invalid options\n{}", f) }; if matches.opt_present("version") { println!("uptime 1.0.0"); diff --git a/users/users.rs b/users/users.rs index 5ff28476b..49becaa9c 100644 --- a/users/users.rs +++ b/users/users.rs @@ -59,7 +59,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => fail!(f.to_err_msg()), + Err(f) => fail!("{}", f), }; if matches.opt_present("help") { diff --git a/wc/wc.rs b/wc/wc.rs index cdbb7ada5..13663144a 100644 --- a/wc/wc.rs +++ b/wc/wc.rs @@ -52,7 +52,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, Err(f) => { - crash!(1, "Invalid options\n{}", f.to_err_msg()) + crash!(1, "Invalid options\n{}", f) } }; diff --git a/whoami/whoami.rs b/whoami/whoami.rs index 1c237060e..b5e354262 100644 --- a/whoami/whoami.rs +++ b/whoami/whoami.rs @@ -52,7 +52,7 @@ pub fn uumain(args: Vec) -> int { ]; let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, - Err(f) => crash!(1, "{}", f.to_err_msg()), + Err(f) => crash!(1, "{}", f), }; if matches.opt_present("help") { println!("whoami 1.0.0"); diff --git a/yes/yes.rs b/yes/yes.rs index 522732fb5..2b6fae868 100644 --- a/yes/yes.rs +++ b/yes/yes.rs @@ -36,7 +36,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts::getopts(args.tail(), opts) { Ok(m) => m, Err(f) => { - crash!(1, "invalid options\n{}", f.to_err_msg()) + crash!(1, "invalid options\n{}", f) } }; if matches.opt_present("help") {