From 0b83a0fa61782b9aa3be6658a92b328218dfac29 Mon Sep 17 00:00:00 2001 From: Arcterus Date: Wed, 5 Feb 2014 09:36:29 -0800 Subject: [PATCH 1/2] wc: fix for latest Rust when applied with @Heather's fix --- wc/wc.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wc/wc.rs b/wc/wc.rs index de0f96f84..47d852d41 100644 --- a/wc/wc.rs +++ b/wc/wc.rs @@ -12,8 +12,8 @@ extern mod extra; use std::os; -use std::io::{print, stdin, stderr, File, result, BufferedReader}; use std::str::from_utf8; +use std::io::{print, stdin, stderr, File, BufferedReader}; use extra::getopts::{groups, Matches}; struct Result { @@ -108,8 +108,8 @@ pub fn wc(files: ~[~str], matches: &Matches) { loop { // reading from a TTY seems to raise a condition on, rather than return Some(0) like a file. // hence the option wrapped in a result here - match result(| | reader.read_until(LF)) { - Ok(Some(raw_line)) => { + match reader.read_until(LF) { + Ok(raw_line) => { // GNU 'wc' only counts lines that end in LF as lines if raw_line.iter().last().unwrap() == &LF { line_count += 1; @@ -223,7 +223,7 @@ fn open(path: ~str) -> Option> { return Some(BufferedReader::new(reader)); } - match result(|| File::open(&std::path::Path::new(path.as_slice()))) { + match File::open(&std::path::Path::new(path.as_slice())) { Ok(fd) => { let reader = ~fd as ~Reader; return Some(BufferedReader::new(reader)); From 06e7e9767e6d3d022eef9b55468619676bd48d96 Mon Sep 17 00:00:00 2001 From: Arcterus Date: Wed, 5 Feb 2014 18:51:41 -0800 Subject: [PATCH 2/2] mkdir: add -V option --- mkdir/mkdir.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdir/mkdir.rs b/mkdir/mkdir.rs index 54f170e56..226c8c8bd 100644 --- a/mkdir/mkdir.rs +++ b/mkdir/mkdir.rs @@ -33,7 +33,7 @@ fn main() { groups::optflag("v", "verbose", "print a message for each printed directory"), groups::optflag("h", "help", "display this help"), - groups::optflag("", "version", "display this version") + groups::optflag("V", "version", "display this version") ]; let matches = match groups::getopts(args.tail(), opts) {