Merge pull request #183 from ebfe/fix-build-master

Adapt to removal of ~str from libstd.
This commit is contained in:
Arcterus
2014-05-23 08:03:34 -07:00
34 changed files with 176 additions and 174 deletions
+6 -6
View File
@@ -36,7 +36,7 @@ mod util;
static NAME: &'static str = "base64";
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let opts = ~[
optflag("d", "decode", "decode data"),
optflag("i", "ignore-garbage", "when decoding, ignore non-alphabetic characters"),
@@ -97,16 +97,16 @@ fn decode(input: &mut Reader, ignore_garbage: bool) {
Err(f) => fail!(f.to_str())
};
to_decode = str::replace(to_decode, "\n", "");
to_decode = str::replace(to_decode.as_slice(), "\n", "");
if ignore_garbage {
let standard_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
to_decode = to_decode
to_decode = to_decode.as_slice()
.trim_chars(|c| !standard_chars.contains_char(c))
.to_owned();
.into_owned()
}
match to_decode.from_base64() {
match to_decode.as_slice().from_base64() {
Ok(bytes) => {
let mut out = stdout();
@@ -148,7 +148,7 @@ fn encode(input: &mut Reader, line_wrap: uint) {
// compatibility.
let final = encoded.replace("\r", "");
println(final);
println(final.as_slice());
}
fn help(progname: &str, usage: &str) {
+17 -17
View File
@@ -24,8 +24,8 @@ static NAME: &'static str = "basename";
static VERSION: &'static str = "1.0.0";
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let program = strip_dir(os::args().get(0));
let args = os::args();
let program = strip_dir(args.get(0).as_slice());
//
// Argument parsing
@@ -52,20 +52,20 @@ fn main() {
}
if matches.opt_present("version") {
println(program + " " + VERSION);
println!("{} {}", program, VERSION);
return;
}
// too few arguments
if args.len() < 2 {
println(program + ": missing operand");
println("Try `" + program + " --help' for more information.");
println!("{}: {}", program, "missing operand");
println!("Try '{} --help' for more information.", program);
return;
}
// too many arguments
else if args.len() > 3 {
println(program + ": extra operand `" + args.get(3).as_slice() + "'");
println("Try `" + program + " --help' for more information.");
println!("{}: extra operand '{}'", program, args.get(3));
println!("Try '{} --help' for more information.", program);
return;
}
@@ -73,19 +73,19 @@ fn main() {
// Main Program Processing
//
let fullname = args.get(1).clone();
let fullname = args.get(1);
let mut name = strip_dir(&fullname.as_slice().to_owned());
let mut name = strip_dir(fullname.as_slice());
if args.len() > 2 {
let suffix = args.get(2).clone();
name = strip_suffix(&name, &suffix.to_owned());
name = strip_suffix(name.as_slice(), suffix.as_slice());
}
println(name);
println(name.as_slice());
}
fn strip_dir(fullname: &~str) -> ~str {
fn strip_dir(fullname: &str) -> StrBuf {
let mut name = StrBuf::new();
for c in fullname.chars().rev() {
@@ -98,14 +98,14 @@ fn strip_dir(fullname: &~str) -> ~str {
return name.as_slice().chars().rev().collect();
}
fn strip_suffix(name: &~str, suffix: &~str) -> ~str {
fn strip_suffix(name: &str, suffix: &str) -> StrBuf {
if name == suffix {
return name.clone();
return name.into_strbuf();
}
if name.ends_with(*suffix) {
return name.slice_to(name.len() - suffix.len()).into_owned();
if name.ends_with(suffix) {
return name.slice_to(name.len() - suffix.len()).into_strbuf();
}
return name.clone();
return name.into_strbuf();
}
+4 -4
View File
@@ -20,7 +20,7 @@ use std::io::stdio::{stdout_raw, stdin_raw};
use std::io::{BufferedWriter};
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let program = args.get(0).as_slice();
let opts = ~[
getopts::optflag("A", "show-all", "equivalent to -vET"),
@@ -103,7 +103,7 @@ pub fn exec(files: Vec<StrBuf>, number: NumberingMode, show_nonprint: bool, show
let is_numbering = number == NumberAll || number == NumberNonEmpty;
for path in files.iter() {
let mut reader = match open(path.to_owned()) {
let mut reader = match open(path.as_slice()) {
Some(f) => f,
None => { continue }
};
@@ -158,7 +158,7 @@ pub fn exec(files: Vec<StrBuf>, number: NumberingMode, show_nonprint: bool, show
let mut buf = ~[0, .. 1024 * 64];
// passthru mode
for path in files.iter() {
let mut reader = match open(path.to_owned()) {
let mut reader = match open(path.as_slice()) {
Some(f) => f,
None => { continue }
};
@@ -175,7 +175,7 @@ pub fn exec(files: Vec<StrBuf>, number: NumberingMode, show_nonprint: bool, show
}
}
fn open(path: ~str) -> Option<Box<Reader>> {
fn open(path: &str) -> Option<Box<Reader>> {
if "-" == path {
return Some(box stdin_raw() as Box<Reader>);
}
+1 -1
View File
@@ -78,7 +78,7 @@ fn open_file(name: &str) -> IoResult<Box<Reader>> {
}
pub fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let opts = [
getopts::optflag("h", "help", "display this help and exit"),
getopts::optflag("V", "version", "output version information and exit"),
+1 -1
View File
@@ -88,7 +88,7 @@ fn open_file(name: &str) -> IoResult<Box<Buffer>> {
}
pub fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let opts = [
getopts::optflag("1", "", "suppress column 1 (lines uniq to FILE1)"),
getopts::optflag("2", "", "suppress column 2 (lines uniq to FILE2)"),
+1 -1
View File
@@ -32,7 +32,7 @@ pub enum Mode {
}
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let opts = ~[
optflag("h", "help", "display this help and exit"),
optflag("", "version", "output version information and exit"),
+1 -1
View File
@@ -17,7 +17,7 @@ use std::io::print;
static VERSION: &'static str = "1.0.0";
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let program = args.get(0).clone();
let opts = ~[
getopts::optflag("z", "zero", "separate output with NUL rather than newline"),
+3 -3
View File
@@ -32,7 +32,7 @@ static VERSION: &'static str = "1.0.0";
struct Options {
all: bool,
program_name: ~str,
program_name: StrBuf,
max_depth: Option<uint>,
total: bool,
separate_dirs: bool,
@@ -91,7 +91,7 @@ fn du(path: &Path, mut my_stat: Stat,
}
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let program = args.get(0).as_slice();
let opts = ~[
// In task
@@ -268,7 +268,7 @@ ers of 1000).",
None => 1024
};
let convert_size = |size: u64| -> ~str {
let convert_size = |size: u64| -> StrBuf {
if matches.opt_present("human-readable") || matches.opt_present("si") {
if size > MB {
format!("{:.1f}M", (size as f64) / (MB as f64))
+5 -5
View File
@@ -70,7 +70,7 @@ fn convert_str(string: &str, index: uint, base: uint) -> (char, int) {
}
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let program = args.get(0).clone();
let opts = ~[
getopts::optflag("n", "", "do not output the trailing newline"),
@@ -118,7 +118,7 @@ fn main() {
let string = matches.free.connect(" ");
if matches.opt_present("e") {
let mut prev_was_slash = false;
let mut iter = string.chars().enumerate();
let mut iter = string.as_slice().chars().enumerate();
loop {
match iter.next() {
Some((index, c)) => {
@@ -142,7 +142,7 @@ fn main() {
't' => print_char('\t'),
'v' => print_char('\x0B'),
'x' => {
let (c, num_char_used) = convert_str(string, index + 1, 16u);
let (c, num_char_used) = convert_str(string.as_slice(), index + 1, 16u);
if num_char_used == 0 {
print_char('\\');
print_char('x');
@@ -154,7 +154,7 @@ fn main() {
}
},
'0' => {
let (c, num_char_used) = convert_str(string, index + 1, 8u);
let (c, num_char_used) = convert_str(string.as_slice(), index + 1, 8u);
if num_char_used == 0 {
print_char('\\');
print_char('0');
@@ -176,7 +176,7 @@ fn main() {
}
}
} else {
print(string);
print(string.as_slice());
}
}
Vendored
+8 -8
View File
@@ -16,9 +16,9 @@
struct options {
ignore_env: bool,
null: bool,
unsets: Vec<~str>,
sets: Vec<(~str, ~str)>,
program: Vec<~str>
unsets: Vec<StrBuf>,
sets: Vec<(StrBuf, StrBuf)>,
program: Vec<StrBuf>
}
fn usage(prog: &str) {
@@ -77,7 +77,7 @@ fn main() {
if wait_cmd {
// we still accept NAME=VAL here but not other options
let mut sp = opt.splitn('=', 1);
let mut sp = opt.as_slice().splitn('=', 1);
let name = sp.next();
let value = sp.next();
@@ -91,7 +91,7 @@ fn main() {
break;
}
}
} else if opt.starts_with("--") {
} else if opt.as_slice().starts_with("--") {
match opt.as_slice() {
"--help" => { usage(prog); return }
"--version" => { version(); return }
@@ -113,7 +113,7 @@ fn main() {
return
}
}
} else if opt.starts_with("-") {
} else if opt.as_slice().starts_with("-") {
if opt.len() == 0 {
// implies -i and stop parsing opts
wait_cmd = true;
@@ -121,7 +121,7 @@ fn main() {
continue;
}
let mut chars = opt.chars();
let mut chars = opt.as_slice().chars();
chars.next();
for c in chars {
@@ -148,7 +148,7 @@ fn main() {
}
} else {
// is it a NAME=VALUE like opt ?
let mut sp = opt.splitn('=', 1);
let mut sp = opt.as_slice().splitn('=', 1);
let name = sp.next();
let value = sp.next();
+11 -11
View File
@@ -28,9 +28,9 @@ static VERSION: &'static str = "1.0.0";
fn main() {
let (args, obs_width) = handle_obsolete(os::args().as_slice().to_owned());
let args = os::args();
let (args, obs_width) = handle_obsolete(args.as_slice());
let program = args.get(0).clone();
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let opts = [
getopts::optflag("b", "bytes", "count using bytes rather than columns (meaning control characters such as newline are not treated specially)"),
@@ -82,24 +82,24 @@ fn main() {
}
}
fn handle_obsolete(args: ~[~str]) -> (~[~str], Option<~str>) {
let mut args: Vec<~str> = args.move_iter().collect();
fn handle_obsolete(args: &[StrBuf]) -> (Vec<StrBuf>, Option<StrBuf>) {
let mut args = Vec::<StrBuf>::from_slice(args);
let mut i = 0;
while i < args.len() {
if args.get(i).char_at(0) == '-' && args.get(i).len() > 1 && args.get(i).char_at(1).is_digit() {
return (args.as_slice().to_owned(),
Some(args.remove(i).unwrap().slice_from(1).to_owned()));
if args.get(i).as_slice().char_at(0) == '-' && args.get(i).len() > 1 && args.get(i).as_slice().char_at(1).is_digit() {
return (args.clone(),
Some(args.remove(i).unwrap().as_slice().slice_from(1).to_owned()));
}
i += 1;
}
(args.as_slice().to_owned(), None)
(args, None)
}
fn fold(filenames: Vec<StrBuf>, bytes: bool, spaces: bool, width: uint) {
for filename in filenames.iter() {
let filename: &str = filename.as_slice();
let buffer = BufferedReader::new(
if filename == "-".to_owned() {
if filename == "-" {
box io::stdio::stdin_raw() as Box<Reader>
} else {
box safe_unwrap!(File::open(&Path::new(filename))) as Box<Reader>
@@ -117,7 +117,7 @@ fn fold_file<T: io::Reader>(file: BufferedReader<T>, bytes: bool, spaces: bool,
println!("");
continue;
}
let line = line.slice_to(line.len() - 1);
let line = line.as_slice().slice_to(line.len() - 1);
if bytes {
let mut i = 0;
while i < line.len() {
@@ -173,7 +173,7 @@ fn fold_file<T: io::Reader>(file: BufferedReader<T>, bytes: bool, spaces: bool,
match slice.rfind(|ch: char| ch.is_whitespace()) {
Some(m) => {
let routput = slice.slice_from(m + 1).to_owned();
let ncount = routput.chars().fold(0, |out, ch: char| out + if ch == '\t' { 8 } else { 1 });
let ncount = routput.as_slice().chars().fold(0, |out, ch: char| out + if ch == '\t' { 8 } else { 1 });
(slice.slice_to(m + 1), routput, ncount)
},
None => (slice, "".to_owned(), 0)
+1 -1
View File
@@ -26,7 +26,7 @@ use c_types::{get_pw_from_args, group};
static NAME: &'static str = "groups";
fn main () {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let options = [
optflag("h", "", "Help")
];
+8 -8
View File
@@ -26,12 +26,12 @@ fn main () {
let mut line_count = 10u;
// handle obsolete -number syntax
let options = match obsolete(os::args().tail().to_owned()) {
let options = match obsolete(os::args().tail()) {
(args, Some(n)) => { line_count = n; args },
(args, None) => args
};
let args: Vec<StrBuf> = options.iter().map(|x| x.to_strbuf()).collect();
let args = options;
let possible_options = [
optopt("n", "number", "Number of lines to print", "n"),
@@ -96,14 +96,14 @@ fn main () {
//
// In case is found, the options vector will get rid of that object so that
// getopts works correctly.
fn obsolete (options: ~[~str]) -> (~[~str], Option<uint>) {
let mut options: Vec<~str> = options.move_iter().collect();
fn obsolete (options: &[StrBuf]) -> (Vec<StrBuf>, Option<uint>) {
let mut options: Vec<StrBuf> = Vec::from_slice(options);
let mut a = 0;
let b = options.len();
let mut current;
while a < b {
current = options.get(a).clone();
let current = options.get(a).clone();
let current = current.as_slice();
if current.len() > 1 && current[0] == '-' as u8 {
let len = current.len();
@@ -115,7 +115,7 @@ fn obsolete (options: ~[~str]) -> (~[~str], Option<uint>) {
if pos == len - 1 {
options.remove(a);
let number : Option<uint> = from_str(current.slice(1,len));
return (options.as_slice().to_owned(), Some(number.unwrap()));
return (options, Some(number.unwrap()));
}
}
}
@@ -123,7 +123,7 @@ fn obsolete (options: ~[~str]) -> (~[~str], Option<uint>) {
a += 1;
};
(options.as_slice().to_owned(), None)
(options, None)
}
fn head<T: Reader> (reader: &mut BufferedReader<T>, line_count:uint) {
+3 -4
View File
@@ -52,7 +52,7 @@ extern {
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let opts = ~[
let opts = [
optflag("", "help", "display this help and exit"),
optflag("", "version", "output version information and exit"),
];
@@ -87,9 +87,8 @@ fn version() {
println!("{} {}", NAME, VERSION);
}
fn get_help_text(progname: &str, usage: &str) -> ~str {
let msg = format!("Usage: \n {0} {1}", progname, usage);
msg
fn get_help_text(progname: &str, usage: &str) -> StrBuf {
format!("Usage: \n {0} {1}", progname, usage)
}
fn help(progname: &str, usage: &str) {
+13 -13
View File
@@ -24,8 +24,8 @@ extern {
}
fn main () {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let program = args.get(0).to_owned();
let args = os::args();
let program = args.get(0);
let options = [
optflag("f", "full", "Default option to show full name"),
@@ -36,31 +36,31 @@ fn main () {
let matches = match getopts(args.tail(), options) {
Ok(m) => { m }
_ => { help_menu(program, options); return; }
_ => { help_menu(program.as_slice(), options); return; }
};
if matches.opt_present("h") {
help_menu(program, options);
help_menu(program.as_slice(), options);
return
}
if matches.opt_present("V") { version(); return }
match matches.free.len() {
0 => {
let hostname: ~str = xgethostname();
let hostname = xgethostname();
if matches.opt_present("s") {
let pos = hostname.find_str(".");
let pos = hostname.as_slice().find_str(".");
if pos.is_some() {
println!("{:s}", hostname.slice_to(pos.unwrap()));
println!("{:s}", hostname.as_slice().slice_to(pos.unwrap()));
return;
}
}
println!("{:s}", hostname);
println!("{:s}", hostname.as_slice());
}
1 => { xsethostname( &matches.free.last().unwrap().as_slice().to_owned() ) }
_ => { help_menu(program, options); }
1 => { xsethostname( matches.free.last().unwrap().as_slice() ) }
_ => { help_menu(program.as_slice(), options); }
};
}
@@ -77,7 +77,7 @@ fn help_menu(program: &str, options: &[getopts::OptGroup]) {
print!("{:s}", usage("Print or set the system's host name.", options));
}
fn xgethostname() -> ~str {
fn xgethostname() -> StrBuf {
let namelen = 256u;
let mut name = Vec::from_elem(namelen, 0u8);
@@ -95,7 +95,7 @@ fn xgethostname() -> ~str {
str::from_utf8(name.slice_to(last_char)).unwrap().to_owned()
}
fn xsethostname(name: &~str) {
fn xsethostname(name: &str) {
let vec_name: Vec<libc::c_char> = name.bytes().map(|c| c as i8).collect();
let err = unsafe {
@@ -103,6 +103,6 @@ fn xsethostname(name: &~str) {
};
if err != 0 {
println!("Cannot set hostname to {:s}", *name);
println!("Cannot set hostname to {:s}", name);
}
}
+1 -1
View File
@@ -88,7 +88,7 @@ extern {
static NAME: &'static str = "id";
fn main () {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let args_t = args.tail();
let options = [
+12 -13
View File
@@ -54,7 +54,7 @@ pub enum Mode {
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let opts = ~[
optflag("h", "help", "display this help and exit"),
@@ -121,12 +121,12 @@ fn table() {
}
}
fn print_signal(signal_name_or_value: ~str) {
fn print_signal(signal_name_or_value: &str) {
for signal in ALL_SIGNALS.iter() {
if signal.name == signal_name_or_value || ("SIG" + signal.name) == signal_name_or_value {
if signal.name == signal_name_or_value || (format!("SIG{}", signal.name).as_slice()) == signal_name_or_value {
println!("{}", signal.value)
exit!(EXIT_OK)
} else if signal_name_or_value == signal.value.to_str() {
} else if signal_name_or_value == signal.value.to_str().as_slice() {
println!("{}", signal.name);
exit!(EXIT_OK)
}
@@ -151,27 +151,26 @@ fn print_signals() {
fn list(arg: Option<StrBuf>) {
match arg {
Some(x) => print_signal(x.to_owned()),
Some(x) => print_signal(x.as_slice()),
None => print_signals(),
};
}
fn get_help_text(progname: &str, usage: &str) -> ~str {
let msg = format!("Usage: \n {0} {1}", progname, usage);
msg
fn get_help_text(progname: &str, usage: &str) -> StrBuf {
format!("Usage: \n {0} {1}", progname, usage)
}
fn help(progname: &str, usage: &str) {
println!("{}", get_help_text(progname, usage));
}
fn signal_by_name_or_value(signal_name_or_value:~str) -> Option<uint> {
if signal_name_or_value == "0".to_owned() {
fn signal_by_name_or_value(signal_name_or_value: &str) -> Option<uint> {
if signal_name_or_value == "0" {
return Some(0);
}
for signal in ALL_SIGNALS.iter() {
let long_name = "SIG" + signal.name;
if signal.name == signal_name_or_value || (signal_name_or_value == signal.value.to_str()) || (long_name == signal_name_or_value) {
let long_name = format!("SIG{}", signal.name);
if signal.name == signal_name_or_value || (signal_name_or_value == signal.value.to_str().as_slice()) || (long_name.as_slice() == signal_name_or_value) {
return Some(signal.value);
}
}
@@ -179,7 +178,7 @@ fn signal_by_name_or_value(signal_name_or_value:~str) -> Option<uint> {
}
fn kill(signalname: &str, pids: std::vec::Vec<StrBuf>) {
let optional_signal_value = signal_by_name_or_value(signalname.to_owned());
let optional_signal_value = signal_by_name_or_value(signalname);
let signal_value = match optional_signal_value {
Some(x) => x,
None => crash!(EXIT_ERR, "unknown signal name {}", signalname)
+4 -4
View File
@@ -18,7 +18,7 @@
extern crate getopts;
extern crate libc;
use std::io::{print, println};
use std::io::print;
use std::os;
use std::str;
use libc::c_char;
@@ -30,7 +30,7 @@ extern {
pub fn getlogin() -> *libc::c_char;
}
unsafe fn get_userlogin() -> ~str {
unsafe fn get_userlogin() -> StrBuf {
let login: *libc::c_char = getlogin();
str::raw::from_c_str(login)
@@ -40,11 +40,11 @@ static NAME: &'static str = "logname";
static VERSION: &'static str = "1.0.0";
fn version() {
println(NAME + " " + VERSION);
println!("{} {}", NAME, VERSION);
}
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let program = args.get(0).clone();
//
+7 -7
View File
@@ -84,7 +84,7 @@ fn md5sum(files: Vec<StrBuf>, binary: bool, check: bool, tag: bool, status: bool
for filename in files.iter() {
let filename: &str = filename.as_slice();
let mut file = BufferedReader::new(
if filename == "-".to_owned() {
if filename == "-" {
box stdin_raw() as Box<Reader>
} else {
box safe_unwrap!(File::open(&Path::new(filename))) as Box<Reader>
@@ -95,9 +95,9 @@ fn md5sum(files: Vec<StrBuf>, binary: bool, check: bool, tag: bool, status: bool
//let mut buffer = BufferedReader::new(file);
for (i, line) in buffer.lines().enumerate() {
let line = safe_unwrap!(line);
let (ck_filename, sum) = match from_gnu(line, bytes) {
let (ck_filename, sum) = match from_gnu(line.as_slice(), bytes) {
Some(m) => m,
None => match from_bsd(line, bytes) {
None => match from_bsd(line.as_slice(), bytes) {
Some(m) => m,
None => {
bad_format += 1;
@@ -112,7 +112,7 @@ fn md5sum(files: Vec<StrBuf>, binary: bool, check: bool, tag: bool, status: bool
}
};
let real_sum = calc_sum(&mut md5, &mut safe_unwrap!(File::open(&Path::new(ck_filename))), binary);
if sum == real_sum {
if sum == real_sum.as_slice() {
if !quiet {
println!("{}: OK", ck_filename);
}
@@ -145,15 +145,15 @@ fn md5sum(files: Vec<StrBuf>, binary: bool, check: bool, tag: bool, status: bool
}
}
fn calc_sum(md5: &mut crypto::md5::Md5, file: &mut Reader, binary: bool) -> ~str {
fn calc_sum(md5: &mut crypto::md5::Md5, file: &mut Reader, binary: bool) -> StrBuf {
let data =
if binary {
(safe_unwrap!(file.read_to_end())).as_slice().to_owned()
(safe_unwrap!(file.read_to_end()))
} else {
(safe_unwrap!(file.read_to_str())).into_bytes()
};
md5.reset();
md5.input(data);
md5.input(data.as_slice());
md5.result_str()
}
+1 -2
View File
@@ -89,8 +89,7 @@ fn print_help(opts: &[getopts::OptGroup]) {
println!("mkdir v{} - make a new directory with the given path", VERSION);
println!("");
println!("Usage:");
print!("{}", getopts::usage("Create the given DIRECTORY(ies)" +
" if they do not exist", opts));
print!("{}", getopts::usage("Create the given DIRECTORY(ies) if they do not exist", opts));
}
/**

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