From 2bb563d4483238c8f288b513762bd875e04c4e07 Mon Sep 17 00:00:00 2001 From: Ben S Date: Wed, 18 Jun 2014 13:39:55 +0100 Subject: [PATCH] Upgrade to latest Rust nightly - s/syntax/phase - no more boxed array syntax - getopts fail implements Show - option#expect now requires &str --- exa.rs | 4 ++-- options.rs | 2 +- sort.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/exa.rs b/exa.rs index d25b0c7..a9549c6 100644 --- a/exa.rs +++ b/exa.rs @@ -1,6 +1,6 @@ #![feature(phase)] extern crate regex; -#[phase(syntax)] extern crate regex_macros; +#[phase(plugin)] extern crate regex_macros; use std::os; @@ -22,7 +22,7 @@ fn main() { let args = os::args(); match Options::getopts(args) { - Err(err) => println!("Invalid options:\n{}", err.to_err_msg()), + Err(err) => println!("Invalid options:\n{}", err), Ok(opts) => { // Default to listing the current directory when a target diff --git a/options.rs b/options.rs index 8255732..45ff75c 100644 --- a/options.rs +++ b/options.rs @@ -31,7 +31,7 @@ impl SortField { impl Options { pub fn getopts(args: Vec) -> Result { - let opts = ~[ + let opts = [ getopts::optflag("a", "all", "show dot-files"), getopts::optflag("b", "binary", "use binary prefixes in file sizes"), getopts::optflag("g", "group", "show group as well as user"), diff --git a/sort.rs b/sort.rs index 9a13709..05e6e08 100644 --- a/sort.rs +++ b/sort.rs @@ -18,7 +18,7 @@ pub enum SortPart { impl SortPart { pub fn from_string(is_digit: bool, slice: &str) -> SortPart { if is_digit { - Numeric(from_str::(slice).expect(slice.to_string())) + Numeric(from_str::(slice).expect(slice)) } else { Stringular(slice.to_ascii_lower()) }