Browse Source

Replace deprecated raw types with libc ones

This limits it to stable until the APIs stabilise (weird, huh?)
Ben S 10 years ago
parent
commit
eaa799c647
2 changed files with 22 additions and 24 deletions
  1. 0 2
      .travis.yml
  2. 22 22
      src/file.rs

+ 0 - 2
.travis.yml

@@ -5,8 +5,6 @@ before_install:
 sudo: true
 language: rust
 rust:
-  - nightly
-  - beta
   - stable
 script:
     - cargo build --verbose

+ 22 - 22
src/file.rs

@@ -17,27 +17,27 @@ use self::fields as f;
 /// see https://github.com/rust-lang/rust/issues/27712
 #[allow(dead_code)]
 mod modes {
-    use std::os::unix::raw;
-
-    pub const USER_READ: raw::mode_t = 0o400;
-    pub const USER_WRITE: raw::mode_t = 0o200;
-    pub const USER_EXECUTE: raw::mode_t = 0o100;
-    pub const USER_RWX: raw::mode_t = 0o700;
-    pub const GROUP_READ: raw::mode_t = 0o040;
-    pub const GROUP_WRITE: raw::mode_t = 0o020;
-    pub const GROUP_EXECUTE: raw::mode_t = 0o010;
-    pub const GROUP_RWX: raw::mode_t = 0o070;
-    pub const OTHER_READ: raw::mode_t = 0o004;
-    pub const OTHER_WRITE: raw::mode_t = 0o002;
-    pub const OTHER_EXECUTE: raw::mode_t = 0o001;
-    pub const OTHER_RWX: raw::mode_t = 0o007;
-    pub const ALL_READ: raw::mode_t = 0o444;
-    pub const ALL_WRITE: raw::mode_t = 0o222;
-    pub const ALL_EXECUTE: raw::mode_t = 0o111;
-    pub const ALL_RWX: raw::mode_t = 0o777;
-    pub const SETUID: raw::mode_t = 0o4000;
-    pub const SETGID: raw::mode_t = 0o2000;
-    pub const STICKY_BIT: raw::mode_t = 0o1000;
+    use libc::mode_t;
+
+    pub const USER_READ: mode_t = 0o400;
+    pub const USER_WRITE: mode_t = 0o200;
+    pub const USER_EXECUTE: mode_t = 0o100;
+    pub const USER_RWX: mode_t = 0o700;
+    pub const GROUP_READ: mode_t = 0o040;
+    pub const GROUP_WRITE: mode_t = 0o020;
+    pub const GROUP_EXECUTE: mode_t = 0o010;
+    pub const GROUP_RWX: mode_t = 0o070;
+    pub const OTHER_READ: mode_t = 0o004;
+    pub const OTHER_WRITE: mode_t = 0o002;
+    pub const OTHER_EXECUTE: mode_t = 0o001;
+    pub const OTHER_RWX: mode_t = 0o007;
+    pub const ALL_READ: mode_t = 0o444;
+    pub const ALL_WRITE: mode_t = 0o222;
+    pub const ALL_EXECUTE: mode_t = 0o111;
+    pub const ALL_RWX: mode_t = 0o777;
+    pub const SETUID: mode_t = 0o4000;
+    pub const SETGID: mode_t = 0o2000;
+    pub const STICKY_BIT: mode_t = 0o1000;
 }
 
 
@@ -432,7 +432,7 @@ fn ext(name: &str) -> Option<String> {
 /// return an object in this `fields` module. These objects are later rendered
 /// into formatted strings in the `output/details` module.
 pub mod fields {
-    use std::os::unix::raw::{blkcnt_t, gid_t, ino_t, nlink_t, time_t, uid_t};
+    use libc::{blkcnt_t, gid_t, ino_t, nlink_t, time_t, uid_t};
 
     pub enum Type {
         File, Directory, Pipe, Link, Special,