Fix compilation for latest rustc.

Some warning are still there.
This commit is contained in:
Dawid Ciężarkiewicz
2014-03-18 22:47:00 -07:00
parent f26621942a
commit 5c690b33d6
24 changed files with 20 additions and 34 deletions
+2
View File
@@ -9,10 +9,12 @@
* that was distributed with this source code.
*/
#[feature(phase)];
#[feature(macro_rules)];
extern crate serialize;
extern crate getopts;
#[phase(syntax, link)] extern crate log;
use std::char;
use std::io::{println, File, stdin, stdout};
-1
View File
@@ -10,7 +10,6 @@
* file that was distributed with this source code.
*/
extern crate extra;
extern crate getopts;
use std::io::{print, println};
-1
View File
@@ -12,7 +12,6 @@
/* last synced with: cat (GNU coreutils) 8.13 */
extern crate extra;
extern crate getopts;
use std::os;
+2
View File
@@ -1,5 +1,6 @@
#[crate_id(name="cp", vers="1.0.0", author="Jordy Dickinson")];
#[feature(macro_rules)];
#[feature(phase)];
/*
* This file is part of the uutils coreutils package.
@@ -11,6 +12,7 @@
*/
extern crate getopts;
#[phase(syntax, link)] extern crate log;
use std::os;
use std::io;
-1
View File
@@ -9,7 +9,6 @@
* file that was distributed with this source code.
*/
extern crate extra;
extern crate getopts;
use std::os;
-1
View File
@@ -10,7 +10,6 @@
* file that was distributed with this source code.
*/
extern crate extra;
extern crate getopts;
use std::os;
Vendored
+6 -6
View File
@@ -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 {
+1 -2
View File
@@ -10,7 +10,6 @@
* Synced with: https://raw.github.com/avsm/src/master/usr.bin/head/head.c
*/
extern crate extra;
extern crate getopts;
use std::os;
@@ -128,7 +127,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 () {
-1
View File
@@ -12,7 +12,6 @@
* https://www.opensource.apple.com/source/shell_cmds/shell_cmds-170/hostname/hostname.c?txt
*/
extern crate extra;
extern crate getopts;
use std::{os,libc,vec,str};
-1
View File
@@ -15,7 +15,6 @@
#[feature(macro_rules)];
extern crate extra;
extern crate getopts;
use std::io::{print, println};
-1
View File
@@ -11,7 +11,6 @@
#[feature(macro_rules)];
extern crate extra;
extern crate getopts;
use std::os;
-1
View File
@@ -13,7 +13,6 @@
#[feature(macro_rules)];
extern crate extra;
extern crate getopts;
use std::os;
-1
View File
@@ -11,7 +11,6 @@
#[feature(macro_rules)];
extern crate extra;
extern crate getopts;
use std::os;
+4 -5
View File
@@ -11,7 +11,6 @@
#[feature(macro_rules)];
extern crate extra;
extern crate getopts;
use std::os;
@@ -87,10 +86,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)
}
-1
View File
@@ -11,7 +11,6 @@
#[feature(macro_rules)];
extern crate extra;
extern crate getopts;
use std::os;
+1 -2
View File
@@ -5,7 +5,6 @@
// TODO: Make -w flag work with decimals
// TODO: Support -f flag
extern crate extra;
extern crate getopts;
use std::os;
@@ -99,7 +98,7 @@ fn done_printing(next: f32, step: f32, last: f32) -> bool {
fn print_seq(first: f32, step: f32, last: f32, separator: ~str, terminator: ~str, pad: bool) {
let mut i = first;
let maxlen = max(first, last).to_str().len();
let maxlen = first.max(last).to_str().len();
while !done_printing(i, step, last) {
let ilen = i.to_str().len();
if pad && ilen < maxlen {
+1 -2
View File
@@ -11,7 +11,6 @@
#[feature(macro_rules)];
extern crate extra;
extern crate getopts;
use std::num;
@@ -88,7 +87,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),
+3 -1
View File
@@ -1,5 +1,7 @@
#[crate_id(name="tee", vers="1.0.0", author="Aleksander Bielawski")];
#[license="MIT"];
#[feature(phase)];
#[feature(macro_rules)];
/*
* This file is part of the uutils coreutils package.
@@ -10,8 +12,8 @@
* file that was distributed with this source code.
*/
extern crate extra;
extern crate getopts;
#[phase(syntax, link)] extern crate log;
use std::io::{println, stdin, stdout, Append, File, Truncate, Write};
use std::io::{IoResult};
-1
View File
@@ -11,7 +11,6 @@
#[feature(macro_rules)];
extern crate extra;
extern crate getopts;
use std::io::{File, Open, ReadWrite, fs};
-1
View File
@@ -16,7 +16,6 @@
#[feature(macro_rules)];
extern crate extra;
extern crate getopts;
use std::{libc,str,os};

Some files were not shown because too many files have changed in this diff Show More