diff --git a/base64/base64.rs b/base64/base64.rs index b42010304..2098c0471 100644 --- a/base64/base64.rs +++ b/base64/base64.rs @@ -89,7 +89,7 @@ pub fn uumain(args: Vec) -> int { Version => version() } - return 0; + 0 } #[allow(dead_code)] diff --git a/basename/basename.rs b/basename/basename.rs index 8f5b2f3ee..6fdb51e54 100644 --- a/basename/basename.rs +++ b/basename/basename.rs @@ -86,7 +86,7 @@ pub fn uumain(args: Vec) -> int { println(name.as_slice()); - return 0; + 0 } fn strip_dir(fullname: &str) -> String { @@ -99,7 +99,7 @@ fn strip_dir(fullname: &str) -> String { name.push_char(c); } - return name.as_slice().chars().rev().collect(); + name.as_slice().chars().rev().collect() } fn strip_suffix(name: &str, suffix: &str) -> String { @@ -111,5 +111,5 @@ fn strip_suffix(name: &str, suffix: &str) -> String { return name.slice_to(name.len() - suffix.len()).into_string(); } - return name.into_string(); + name.into_string() } diff --git a/cat/cat.rs b/cat/cat.rs index ba8fad3f5..79caf0960 100644 --- a/cat/cat.rs +++ b/cat/cat.rs @@ -81,7 +81,7 @@ pub fn uumain(args: Vec) -> int { exec(files, number_mode, show_nonprint, show_ends, show_tabs, squeeze_blank); - return 0; + 0 } #[deriving(Eq, PartialEq)] @@ -285,12 +285,12 @@ fn open(path: &str) -> Option<(Box, bool)> { } match File::open(&std::path::Path::new(path)) { - Ok(f) => return Some((box f as Box, false)), + Ok(f) => Some((box f as Box, false)), Err(e) => { (writeln!(stderr(), "cat: {0:s}: {1:s}", path, e.to_str())).unwrap(); - return None; + None }, - }; + } } struct UnsafeWriter<'a, W> { diff --git a/cksum/cksum.rs b/cksum/cksum.rs index e832c2911..8d1d5cba0 100644 --- a/cksum/cksum.rs +++ b/cksum/cksum.rs @@ -130,5 +130,5 @@ pub fn uumain(args: Vec) -> int { } } - return exit_code; + exit_code } diff --git a/comm/comm.rs b/comm/comm.rs index e2d669777..df5137516 100644 --- a/comm/comm.rs +++ b/comm/comm.rs @@ -136,5 +136,5 @@ pub fn uumain(args: Vec) -> int { comm(&mut f1, &mut f2, &matches); - return 0; + 0 } diff --git a/cp/cp.rs b/cp/cp.rs index b23eb2c6a..2bdc19fb9 100644 --- a/cp/cp.rs +++ b/cp/cp.rs @@ -63,7 +63,7 @@ pub fn uumain(args: Vec) -> int { Version => version(), } - return 0; + 0 } fn version() { diff --git a/dirname/dirname.rs b/dirname/dirname.rs index 65a830793..3e6714f23 100644 --- a/dirname/dirname.rs +++ b/dirname/dirname.rs @@ -68,5 +68,5 @@ directory).", opts).as_slice()); println!("Try '{0:s} --help' for more information.", program); } - return 0; + 0 } diff --git a/du/du.rs b/du/du.rs index eb14aea99..36abca4df 100644 --- a/du/du.rs +++ b/du/du.rs @@ -86,7 +86,7 @@ fn du(path: &Path, mut my_stat: Stat, stats.push(Arc::new(my_stat)); - return stats; + stats } #[allow(dead_code)] @@ -367,5 +367,5 @@ Try '{program} --help' for more information.", s, program = program); print!("{}", line_separator); } - return 0; + 0 } diff --git a/echo/echo.rs b/echo/echo.rs index 4d57d19a7..f8edf5175 100644 --- a/echo/echo.rs +++ b/echo/echo.rs @@ -66,7 +66,8 @@ fn convert_str(string: &str, index: uint, base: uint) -> (char, int) { } } } - return (to_char(&bytes, base), max_digits) + + (to_char(&bytes, base), max_digits) } #[allow(dead_code)] @@ -187,5 +188,5 @@ pub fn uumain(args: Vec) -> int { println!("") } - return 0; + 0 } diff --git a/env/env.rs b/env/env.rs index c02b962f3..f2434974d 100644 --- a/env/env.rs +++ b/env/env.rs @@ -211,5 +211,5 @@ pub fn uumain(args: Vec) -> int { print_env(opts.null); } - return 0; + 0 } diff --git a/fold/fold.rs b/fold/fold.rs index 5818e0fb8..711bc879e 100644 --- a/fold/fold.rs +++ b/fold/fold.rs @@ -83,7 +83,7 @@ pub fn uumain(args: Vec) -> int { fold(files, bytes, spaces, width); } - return 0; + 0 } fn handle_obsolete(args: &[String]) -> (Vec, Option) { diff --git a/groups/groups.rs b/groups/groups.rs index b678099b2..abb770972 100644 --- a/groups/groups.rs +++ b/groups/groups.rs @@ -43,5 +43,5 @@ pub fn uumain(args: Vec) -> int { group(get_pw_from_args(&matches.free), true); - return 0; + 0 } diff --git a/head/head.rs b/head/head.rs index 6840588a4..37adad266 100644 --- a/head/head.rs +++ b/head/head.rs @@ -94,7 +94,7 @@ pub fn uumain(args: Vec) -> int { } } - return 0; + 0 } // It searches for an option in the form of -123123 diff --git a/hostid/hostid.rs b/hostid/hostid.rs index 341f0aefc..dd6a7f58c 100644 --- a/hostid/hostid.rs +++ b/hostid/hostid.rs @@ -84,7 +84,7 @@ pub fn uumain(args: Vec) -> int { Version => version(), } - return 0; + 0 } fn version() { diff --git a/hostname/hostname.rs b/hostname/hostname.rs index c0b7a3210..ed4f30930 100644 --- a/hostname/hostname.rs +++ b/hostname/hostname.rs @@ -65,7 +65,7 @@ pub fn uumain(args: Vec) -> int { _ => { help_menu(program.as_slice(), options); } }; - return 0; + 0 } fn version() { diff --git a/id/id.rs b/id/id.rs index b61ee9a9d..6952b8d2d 100644 --- a/id/id.rs +++ b/id/id.rs @@ -195,7 +195,7 @@ pub fn uumain(args: Vec) -> int { id_print(possible_pw, false, true, true) } - return 0; + 0 } fn pretty(possible_pw: Option) { diff --git a/kill/kill.rs b/kill/kill.rs index f38f37e8d..0fbe8475f 100644 --- a/kill/kill.rs +++ b/kill/kill.rs @@ -97,7 +97,7 @@ pub fn uumain(args: Vec) -> int { Version => version(), } - return 0; + 0 } fn version() { @@ -177,7 +177,7 @@ fn signal_by_name_or_value(signal_name_or_value: &str) -> Option { return Some(signal.value); } } - return None; + None } fn kill(signalname: &str, pids: std::vec::Vec) { diff --git a/logname/logname.rs b/logname/logname.rs index 4f34eb40b..d28dca8f0 100644 --- a/logname/logname.rs +++ b/logname/logname.rs @@ -78,7 +78,7 @@ pub fn uumain(args: Vec) -> int { exec(); - return 0; + 0 } fn exec() { diff --git a/md5sum/md5sum.rs b/md5sum/md5sum.rs index 369d1b3ab..da4133573 100644 --- a/md5sum/md5sum.rs +++ b/md5sum/md5sum.rs @@ -80,7 +80,7 @@ pub fn uumain(args: Vec) -> int { } } - return 0; + 0 } fn md5sum(files: Vec, binary: bool, check: bool, tag: bool, status: bool, quiet: bool, strict: bool, warn: bool) -> Result<(), int> { @@ -150,7 +150,7 @@ fn md5sum(files: Vec, binary: bool, check: bool, tag: bool, status: bool } } - return Ok(()); + Ok(()) } fn calc_sum(md5: &mut crypto::md5::Md5, file: &mut Reader, binary: bool) -> String { diff --git a/mkdir/mkdir.rs b/mkdir/mkdir.rs index 5fef9b8ad..7dadfa0ce 100644 --- a/mkdir/mkdir.rs +++ b/mkdir/mkdir.rs @@ -85,8 +85,8 @@ pub fn uumain(args: Vec) -> int { crash!(1, "missing operand"); } match exec(dirs, mk_parents, mode, verbose_flag) { - Ok(()) => return 0, - Err(e) => return e + Ok(()) => 0, + Err(e) => e } } @@ -151,7 +151,7 @@ fn exec(dirs: Vec, mk_parents: bool, mode: FilePermission, verbose: bool } } - return result; + result } /** diff --git a/paste/paste.rs b/paste/paste.rs index 9d55185fe..1cc5c3c42 100644 --- a/paste/paste.rs +++ b/paste/paste.rs @@ -57,7 +57,7 @@ pub fn uumain(args: Vec) -> int { paste(matches.free, serial, delimiters.as_slice()); } - return 0; + 0 } fn paste(filenames: Vec, serial: bool, delimiters: &str) { diff --git a/printenv/printenv.rs b/printenv/printenv.rs index f0e928ca4..8eb9cde19 100644 --- a/printenv/printenv.rs +++ b/printenv/printenv.rs @@ -60,7 +60,7 @@ pub fn uumain(args: Vec) -> int { exec(matches.free, separator); - return 0; + 0 } pub fn exec(args: Vec, separator: &str) { diff --git a/pwd/pwd.rs b/pwd/pwd.rs index a89b5b906..7283179c7 100644 --- a/pwd/pwd.rs +++ b/pwd/pwd.rs @@ -58,5 +58,5 @@ pub fn uumain(args: Vec) -> int { return 0; } - return 0; + 0 } diff --git a/rm/rm.rs b/rm/rm.rs index a37511303..f0372391e 100644 --- a/rm/rm.rs +++ b/rm/rm.rs @@ -124,7 +124,7 @@ pub fn uumain(args: Vec) -> int { } } - return 0; + 0 } // TODO: implement one-file-system @@ -167,7 +167,7 @@ fn remove(files: Vec, force: bool, interactive: InteractiveMode, one_fs: } } - return r; + r } fn remove_dir(path: &Path, name: &str, interactive: InteractiveMode, verbose: bool) -> Result<(), int> { @@ -187,7 +187,7 @@ fn remove_dir(path: &Path, name: &str, interactive: InteractiveMode, verbose: bo } } - return Ok(()); + Ok(()) } fn remove_file(path: &Path, name: &str, interactive: InteractiveMode, verbose: bool) -> Result<(), int> { @@ -207,7 +207,7 @@ fn remove_file(path: &Path, name: &str, interactive: InteractiveMode, verbose: b } } - return Ok(()); + Ok(()) } fn prompt_file(path: &Path, name: &str) -> bool { diff --git a/rmdir/rmdir.rs b/rmdir/rmdir.rs index 56a51110e..d2dcba897 100644 --- a/rmdir/rmdir.rs +++ b/rmdir/rmdir.rs @@ -66,7 +66,7 @@ pub fn uumain(args: Vec) -> int { } } - return 0; + 0 } fn remove(dirs: Vec, ignore: bool, parents: bool, verbose: bool) -> Result<(), int>{ @@ -87,7 +87,7 @@ fn remove(dirs: Vec, ignore: bool, parents: bool, verbose: bool) -> Resu } } - return r; + r } fn remove_dir(path: &Path, dir: &str, ignore: bool, parents: bool, verbose: bool) -> Result<(), int> { @@ -124,6 +124,6 @@ fn remove_dir(path: &Path, dir: &str, ignore: bool, parents: bool, verbose: bool r = Err(1); } - return r; + r } diff --git a/seq/seq.rs b/seq/seq.rs index bc9ddc353..392bef040 100644 --- a/seq/seq.rs +++ b/seq/seq.rs @@ -88,7 +88,7 @@ pub fn uumain(args: Vec) -> int { let terminator = escape_sequences(matches.opt_str("t").unwrap_or(separator.to_string()).as_slice()); print_seq(first, step, last, separator, terminator, matches.opt_present("w")); - return 0; + 0 } fn done_printing(next: f32, step: f32, last: f32) -> bool { diff --git a/sleep/sleep.rs b/sleep/sleep.rs index f5b0fb756..5f07ac40f 100644 --- a/sleep/sleep.rs +++ b/sleep/sleep.rs @@ -64,7 +64,7 @@ specified by the sum of their values.", opts).as_slice()); sleep(matches.free); } - return 0; + 0 } fn sleep(args: Vec) { diff --git a/sum/sum.rs b/sum/sum.rs index e8d7ed213..177fe7590 100644 --- a/sum/sum.rs +++ b/sum/sum.rs @@ -129,5 +129,5 @@ pub fn uumain(args: Vec) -> int { println!("{} {}", sum, blocks); - return 0; + 0 } diff --git a/tac/tac.rs b/tac/tac.rs index 19c452e4f..30ddfeb20 100644 --- a/tac/tac.rs +++ b/tac/tac.rs @@ -70,7 +70,7 @@ pub fn uumain(args: Vec) -> int { tac(files, before, regex, separator.as_slice()); } - return 0; + 0 } fn tac(filenames: Vec, before: bool, _: bool, separator: &str) { diff --git a/touch/touch.rs b/touch/touch.rs index 8a08f9467..abe98a39f 100644 --- a/touch/touch.rs +++ b/touch/touch.rs @@ -132,7 +132,7 @@ pub fn uumain(args: Vec) -> int { } } - return 0; + 0 } fn stat(path: &Path, follow: bool) -> std::io::FileStat { diff --git a/tr/tr.rs b/tr/tr.rs index f52d2a6bc..03e78f251 100644 --- a/tr/tr.rs +++ b/tr/tr.rs @@ -199,5 +199,5 @@ pub fn uumain(args: Vec) -> int { tr(set1.as_slice(), set2.as_slice()); } - return 0; + 0 } diff --git a/truncate/truncate.rs b/truncate/truncate.rs index 8cf886014..1f9f54925 100644 --- a/truncate/truncate.rs +++ b/truncate/truncate.rs @@ -100,7 +100,7 @@ file based on its current size: } } - return 0; + 0 } fn truncate(no_create: bool, _: bool, reference: Option, size: Option, filenames: Vec) -> Result<(), int> { @@ -159,7 +159,7 @@ fn truncate(no_create: bool, _: bool, reference: Option, size: Option (u64, TruncateMode) { diff --git a/tty/tty.rs b/tty/tty.rs index d715dd968..1f10b9c34 100644 --- a/tty/tty.rs +++ b/tty/tty.rs @@ -71,7 +71,7 @@ pub fn uumain(args: Vec) -> int { } }; - return exit_code as int; + exit_code as int } fn usage () { diff --git a/uname/uname.rs b/uname/uname.rs index e25334275..fc4cf3c8b 100644 --- a/uname/uname.rs +++ b/uname/uname.rs @@ -105,5 +105,5 @@ pub fn uumain(args: Vec) -> int { } println!("{}", output.as_slice().trim_left()); - return 0; + 0 } diff --git a/unlink/unlink.rs b/unlink/unlink.rs index 4221eafa7..aa07f0930 100644 --- a/unlink/unlink.rs +++ b/unlink/unlink.rs @@ -87,5 +87,5 @@ pub fn uumain(args: Vec) -> int { } } - return 0; + 0 } diff --git a/uptime/uptime.rs b/uptime/uptime.rs index eac380d0e..cdee621ec 100644 --- a/uptime/uptime.rs +++ b/uptime/uptime.rs @@ -81,7 +81,7 @@ pub fn uumain(args: Vec) -> int { print_nusers(user_count); print_loadavg(); - return 0; + 0 } fn print_loadavg() { diff --git a/users/users.rs b/users/users.rs index 4017aad6f..5ff28476b 100644 --- a/users/users.rs +++ b/users/users.rs @@ -84,7 +84,7 @@ pub fn uumain(args: Vec) -> int { exec(filename); - return 0; + 0 } fn exec(filename: &str) { diff --git a/wc/wc.rs b/wc/wc.rs index 9ab77c68d..cdbb7ada5 100644 --- a/wc/wc.rs +++ b/wc/wc.rs @@ -81,7 +81,7 @@ pub fn uumain(args: Vec) -> int { Err(e) => return e } - return 0; + 0 } static CR: u8 = '\r' as u8; @@ -192,7 +192,7 @@ pub fn wc(files: Vec, matches: &Matches) -> StdResult<(), int> { print_stats("total", total_line_count, total_word_count, total_char_count, total_byte_count, total_longest_line_length, matches, max_str_len); } - return Ok(()); + Ok(()) } fn print_stats(filename: &str, line_count: uint, word_count: uint, char_count: uint, @@ -241,11 +241,11 @@ fn open(path: String) -> StdResult>, int> { match File::open(&std::path::Path::new(path.as_slice())) { Ok(fd) => { let reader = box fd as Box; - return Ok(BufferedReader::new(reader)); + Ok(BufferedReader::new(reader)) }, Err(e) => { show_error!("wc: {0:s}: {1:s}", path, e.desc.to_str()); - return Err(1); + Err(1) } } } diff --git a/whoami/whoami.rs b/whoami/whoami.rs index 65deb2d13..1c237060e 100644 --- a/whoami/whoami.rs +++ b/whoami/whoami.rs @@ -70,7 +70,7 @@ pub fn uumain(args: Vec) -> int { exec(); - return 0; + 0 } pub fn exec() { diff --git a/yes/yes.rs b/yes/yes.rs index 38d0276b5..522732fb5 100644 --- a/yes/yes.rs +++ b/yes/yes.rs @@ -59,7 +59,7 @@ pub fn uumain(args: Vec) -> int { exec(string.as_slice()); - return 0; + 0 } pub fn exec(string: &str) {