mirror of
https://github.com/uutils/coreutils
synced 2024-11-15 01:17:09 +00:00
Merge pull request #130 from alan-andrade/fix_master
Fix master by comparing against slices, not ~
This commit is contained in:
commit
a75e42d4db
4 changed files with 12 additions and 12 deletions
12
env/env.rs
vendored
12
env/env.rs
vendored
|
@ -92,13 +92,13 @@ fn main() {
|
|||
}
|
||||
}
|
||||
} else if opt.starts_with("--") {
|
||||
match *opt {
|
||||
~"--help" => { usage(prog); return }
|
||||
~"--version" => { version(); return }
|
||||
match opt.as_slice() {
|
||||
"--help" => { usage(prog); return }
|
||||
"--version" => { version(); return }
|
||||
|
||||
~"--ignore-environment" => opts.ignore_env = true,
|
||||
~"--null" => opts.null = true,
|
||||
~"--unset" => {
|
||||
"--ignore-environment" => opts.ignore_env = true,
|
||||
"--null" => opts.null = true,
|
||||
"--unset" => {
|
||||
let var = iter.next();
|
||||
|
||||
match var {
|
||||
|
|
|
@ -128,7 +128,7 @@ fn obsolete (options: &mut ~[~str]) -> Option<uint> {
|
|||
}
|
||||
|
||||
fn head<T: Reader> (reader: &mut BufferedReader<T>, line_count:uint) {
|
||||
for line in reader.lines().take(line_count) { print!("{:s}", line); }
|
||||
for line in reader.lines().take(line_count) { print!("{}", line); }
|
||||
}
|
||||
|
||||
fn version () {
|
||||
|
|
8
rm/rm.rs
8
rm/rm.rs
|
@ -87,10 +87,10 @@ fn main() {
|
|||
} else if matches.opt_present("I") {
|
||||
InteractiveOnce
|
||||
} else if matches.opt_present("interactive") {
|
||||
match matches.opt_str("interactive").unwrap() {
|
||||
~"none" => InteractiveNone,
|
||||
~"once" => InteractiveOnce,
|
||||
~"always" => InteractiveAlways,
|
||||
match matches.opt_str("interactive").unwrap().as_slice() {
|
||||
"none" => InteractiveNone,
|
||||
"once" => InteractiveOnce,
|
||||
"always" => InteractiveAlways,
|
||||
val => {
|
||||
crash!(1, "Invalid argument to interactive ({})", val)
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ fn sleep(args: &[~str]) {
|
|||
}
|
||||
|
||||
fn match_suffix(arg: &mut ~str) -> Result<int, ~str> {
|
||||
let result = match (*arg).pop_char() {
|
||||
let result = match (*arg).pop_char().unwrap() {
|
||||
's' | 'S' => Ok(1),
|
||||
'm' | 'M' => Ok(60),
|
||||
'h' | 'H' => Ok(60 * 60),
|
||||
|
|
Loading…
Reference in a new issue