Upgrade to latest Rust nightly

- s/syntax/phase
- no more boxed array syntax
- getopts fail implements Show
- option#expect now requires &str
This commit is contained in:
Ben S 2014-06-18 13:39:55 +01:00
parent 98b759d65d
commit 2bb563d448
3 changed files with 4 additions and 4 deletions

4
exa.rs
View File

@ -1,6 +1,6 @@
#![feature(phase)] #![feature(phase)]
extern crate regex; extern crate regex;
#[phase(syntax)] extern crate regex_macros; #[phase(plugin)] extern crate regex_macros;
use std::os; use std::os;
@ -22,7 +22,7 @@ fn main() {
let args = os::args(); let args = os::args();
match Options::getopts(args) { match Options::getopts(args) {
Err(err) => println!("Invalid options:\n{}", err.to_err_msg()), Err(err) => println!("Invalid options:\n{}", err),
Ok(opts) => { Ok(opts) => {
// Default to listing the current directory when a target // Default to listing the current directory when a target

View File

@ -31,7 +31,7 @@ impl SortField {
impl Options { impl Options {
pub fn getopts(args: Vec<String>) -> Result<Options, getopts::Fail_> { pub fn getopts(args: Vec<String>) -> Result<Options, getopts::Fail_> {
let opts = ~[ let opts = [
getopts::optflag("a", "all", "show dot-files"), getopts::optflag("a", "all", "show dot-files"),
getopts::optflag("b", "binary", "use binary prefixes in file sizes"), getopts::optflag("b", "binary", "use binary prefixes in file sizes"),
getopts::optflag("g", "group", "show group as well as user"), getopts::optflag("g", "group", "show group as well as user"),

View File

@ -18,7 +18,7 @@ pub enum SortPart {
impl SortPart { impl SortPart {
pub fn from_string(is_digit: bool, slice: &str) -> SortPart { pub fn from_string(is_digit: bool, slice: &str) -> SortPart {
if is_digit { if is_digit {
Numeric(from_str::<u64>(slice).expect(slice.to_string())) Numeric(from_str::<u64>(slice).expect(slice))
} else { } else {
Stringular(slice.to_ascii_lower()) Stringular(slice.to_ascii_lower())
} }