Procházet zdrojové kódy

Upgrade to latest Rust nightly

Ben S před 11 roky
rodič
revize
818fc615a8
2 změnil soubory, kde provedl 8 přidání a 6 odebrání
  1. 5 3
      exa.rs
  2. 3 3
      file.rs

+ 5 - 3
exa.rs

@@ -16,8 +16,10 @@ struct Options {
 }
 
 fn main() {
-    let args = os::args();
-    let program = args[0].as_slice();
+    let args: Vec<StrBuf> = os::args().iter()
+        .map(|x| x.to_strbuf())
+        .collect();
+
     let opts = ~[
         getopts::optflag("a", "all", "show dot-files")
     ];
@@ -32,7 +34,7 @@ fn main() {
     };
 
     let strs = if matches.free.is_empty() {
-        vec!("./".to_owned())
+        vec!("./".to_strbuf())
     }
     else {
         matches.free.clone()

+ 3 - 3
file.rs

@@ -74,7 +74,7 @@ impl<'a> File<'a> {
     fn file_colour(&self) -> Style {
         if self.stat.kind == io::TypeDirectory {
             Blue.normal()
-        } else if self.stat.perm & io::UserExecute == io::UserExecute {
+        } else if self.stat.perm.contains(io::UserExecute) {
             Green.normal()
         } else if self.name.ends_with("~") {
             Black.bold()
@@ -100,8 +100,8 @@ impl<'a> File<'a> {
     }
 }
 
-fn bit(bits: u32, bit: u32, other: &'static str, style: Style) -> ~str {
-    if bits & bit == bit {
+fn bit(bits: io::FilePermission, bit: io::FilePermission, other: &'static str, style: Style) -> ~str {
+    if bits.contains(bit) {
         style.paint(other.to_owned())
     } else {
         Black.bold().paint("-".to_owned())