Explorar el Código

Upgrade to latest Rust nightly

- s/syntax/phase
- no more boxed array syntax
- getopts fail implements Show
- option#expect now requires &str
Ben S hace 11 años
padre
commit
2bb563d448
Se han modificado 3 ficheros con 4 adiciones y 4 borrados
  1. 2 2
      exa.rs
  2. 1 1
      options.rs
  3. 1 1
      sort.rs

+ 2 - 2
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

+ 1 - 1
options.rs

@@ -31,7 +31,7 @@ impl SortField {
 
 impl Options {
     pub fn getopts(args: Vec<String>) -> Result<Options, getopts::Fail_> {
-        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"),

+ 1 - 1
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::<u64>(slice).expect(slice.to_string()))
+            Numeric(from_str::<u64>(slice).expect(slice))
         } else {
             Stringular(slice.to_ascii_lower())
         }