mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
Remove tail return statements.
Per review feedback.
This commit is contained in:
+1
-1
@@ -89,7 +89,7 @@ pub fn uumain(args: Vec<String>) -> int {
|
||||
Version => version()
|
||||
}
|
||||
|
||||
return 0;
|
||||
0
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
|
||||
@@ -86,7 +86,7 @@ pub fn uumain(args: Vec<String>) -> 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()
|
||||
}
|
||||
|
||||
+4
-4
@@ -81,7 +81,7 @@ pub fn uumain(args: Vec<String>) -> 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<Reader>, bool)> {
|
||||
}
|
||||
|
||||
match File::open(&std::path::Path::new(path)) {
|
||||
Ok(f) => return Some((box f as Box<Reader>, false)),
|
||||
Ok(f) => Some((box f as Box<Reader>, false)),
|
||||
Err(e) => {
|
||||
(writeln!(stderr(), "cat: {0:s}: {1:s}", path, e.to_str())).unwrap();
|
||||
return None;
|
||||
None
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
struct UnsafeWriter<'a, W> {
|
||||
|
||||
+1
-1
@@ -130,5 +130,5 @@ pub fn uumain(args: Vec<String>) -> int {
|
||||
}
|
||||
}
|
||||
|
||||
return exit_code;
|
||||
exit_code
|
||||
}
|
||||
|
||||
+1
-1
@@ -136,5 +136,5 @@ pub fn uumain(args: Vec<String>) -> int {
|
||||
|
||||
comm(&mut f1, &mut f2, &matches);
|
||||
|
||||
return 0;
|
||||
0
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ pub fn uumain(args: Vec<String>) -> int {
|
||||
Version => version(),
|
||||
}
|
||||
|
||||
return 0;
|
||||
0
|
||||
}
|
||||
|
||||
fn version() {
|
||||
|
||||
+1
-1
@@ -68,5 +68,5 @@ directory).", opts).as_slice());
|
||||
println!("Try '{0:s} --help' for more information.", program);
|
||||
}
|
||||
|
||||
return 0;
|
||||
0
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
+3
-2
@@ -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<String>) -> int {
|
||||
println!("")
|
||||
}
|
||||
|
||||
return 0;
|
||||
0
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -211,5 +211,5 @@ pub fn uumain(args: Vec<String>) -> int {
|
||||
print_env(opts.null);
|
||||
}
|
||||
|
||||
return 0;
|
||||
0
|
||||
}
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ pub fn uumain(args: Vec<String>) -> int {
|
||||
fold(files, bytes, spaces, width);
|
||||
}
|
||||
|
||||
return 0;
|
||||
0
|
||||
}
|
||||
|
||||
fn handle_obsolete(args: &[String]) -> (Vec<String>, Option<String>) {
|
||||
|
||||
+1
-1
@@ -43,5 +43,5 @@ pub fn uumain(args: Vec<String>) -> int {
|
||||
|
||||
group(get_pw_from_args(&matches.free), true);
|
||||
|
||||
return 0;
|
||||
0
|
||||
}
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ pub fn uumain(args: Vec<String>) -> int {
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
0
|
||||
}
|
||||
|
||||
// It searches for an option in the form of -123123
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ pub fn uumain(args: Vec<String>) -> int {
|
||||
Version => version(),
|
||||
}
|
||||
|
||||
return 0;
|
||||
0
|
||||
}
|
||||
|
||||
fn version() {
|
||||
|
||||
@@ -65,7 +65,7 @@ pub fn uumain(args: Vec<String>) -> int {
|
||||
_ => { help_menu(program.as_slice(), options); }
|
||||
};
|
||||
|
||||
return 0;
|
||||
0
|
||||
}
|
||||
|
||||
fn version() {
|
||||
|
||||
@@ -195,7 +195,7 @@ pub fn uumain(args: Vec<String>) -> int {
|
||||
id_print(possible_pw, false, true, true)
|
||||
}
|
||||
|
||||
return 0;
|
||||
0
|
||||
}
|
||||
|
||||
fn pretty(possible_pw: Option<c_passwd>) {
|
||||
|
||||
+2
-2
@@ -97,7 +97,7 @@ pub fn uumain(args: Vec<String>) -> int {
|
||||
Version => version(),
|
||||
}
|
||||
|
||||
return 0;
|
||||
0
|
||||
}
|
||||
|
||||
fn version() {
|
||||
@@ -177,7 +177,7 @@ fn signal_by_name_or_value(signal_name_or_value: &str) -> Option<uint> {
|
||||
return Some(signal.value);
|
||||
}
|
||||
}
|
||||
return None;
|
||||
None
|
||||
}
|
||||
|
||||
fn kill(signalname: &str, pids: std::vec::Vec<String>) {
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ pub fn uumain(args: Vec<String>) -> int {
|
||||
|
||||
exec();
|
||||
|
||||
return 0;
|
||||
0
|
||||
}
|
||||
|
||||
fn exec() {
|
||||
|
||||
+2
-2
@@ -80,7 +80,7 @@ pub fn uumain(args: Vec<String>) -> int {
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
0
|
||||
}
|
||||
|
||||
fn md5sum(files: Vec<String>, binary: bool, check: bool, tag: bool, status: bool, quiet: bool, strict: bool, warn: bool) -> Result<(), int> {
|
||||
@@ -150,7 +150,7 @@ fn md5sum(files: Vec<String>, 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 {
|
||||
|
||||
+3
-3
@@ -85,8 +85,8 @@ pub fn uumain(args: Vec<String>) -> 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<String>, mk_parents: bool, mode: FilePermission, verbose: bool
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
result
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user