Browse Source

Fix my own broken changes

- Fix visibility errors I stupidly didn't test before committing earlier
  today
- Silence warnings about casting that were necessary for ARM
- Update dependencies
Benjamin Sago 10 năm trước cách đây
mục cha
commit
d3846468a3
3 tập tin đã thay đổi với 17 bổ sung16 xóa
  1. 6 6
      Cargo.lock
  2. 1 0
      src/feature/xattr.rs
  3. 10 10
      src/filetype.rs

+ 6 - 6
Cargo.lock

@@ -66,7 +66,7 @@ name = "gdi32-sys"
 version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -113,7 +113,7 @@ dependencies = [
  "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "libssh2-sys 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
  "libz-sys 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -133,7 +133,7 @@ dependencies = [
  "cmake 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "libz-sys 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -198,7 +198,7 @@ dependencies = [
 
 [[package]]
 name = "openssl-sys"
-version = "0.7.6"
+version = "0.7.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "gdi32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -296,7 +296,7 @@ name = "user32-sys"
 version = "0.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -319,7 +319,7 @@ dependencies = [
 
 [[package]]
 name = "winapi"
-version = "0.2.5"
+version = "0.2.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]

+ 1 - 0
src/feature/xattr.rs

@@ -1,4 +1,5 @@
 //! Extended attribute support for Darwin and Linux systems.
+#![allow(trivial_casts)]  // for ARM
 extern crate libc;
 
 use std::io;

+ 10 - 10
src/filetype.rs

@@ -2,7 +2,7 @@ use file::File;
 
 
 impl<'_> File<'_> {
-    fn is_immediate(&self) -> bool {
+    pub fn is_immediate(&self) -> bool {
         self.name.starts_with("README") || self.name_is_one_of( &[
             "Makefile", "Cargo.toml", "SConstruct", "CMakeLists.txt",
             "build.gradle", "Rakefile", "Gruntfile.js",
@@ -10,7 +10,7 @@ impl<'_> File<'_> {
         ])
     }
 
-    fn is_image(&self) -> bool {
+    pub fn is_image(&self) -> bool {
         self.extension_is_one_of( &[
             "png", "jpeg", "jpg", "gif", "bmp", "tiff", "tif",
             "ppm", "pgm", "pbm", "pnm", "webp", "raw", "arw",
@@ -19,33 +19,33 @@ impl<'_> File<'_> {
         ])
     }
 
-    fn is_video(&self) -> bool {
+    pub fn is_video(&self) -> bool {
         self.extension_is_one_of( &[
             "avi", "flv", "m2v", "mkv", "mov", "mp4", "mpeg",
             "mpg", "ogm", "ogv", "vob", "wmv",
         ])
     }
 
-    fn is_music(&self) -> bool {
+    pub fn is_music(&self) -> bool {
         self.extension_is_one_of( &[
             "aac", "m4a", "mp3", "ogg", "wma",
         ])
     }
 
-    fn is_lossless(&self) -> bool {
+    pub fn is_lossless(&self) -> bool {
         self.extension_is_one_of( &[
             "alac", "ape", "flac", "wav",
         ])
     }
 
-    fn is_crypto(&self) -> bool {
+    pub fn is_crypto(&self) -> bool {
         self.extension_is_one_of( &[
             "zip", "tar", "Z", "gz", "bz2", "a", "ar", "7z",
             "iso", "dmg", "tc", "rar", "par",
         ])
     }
 
-    fn is_document(&self) -> bool {
+    pub fn is_document(&self) -> bool {
         self.extension_is_one_of( &[
             "djvu", "doc", "docx", "dvi", "eml", "eps", "fotd",
             "odp", "odt", "pdf", "ppt", "pptx", "rtf",
@@ -53,20 +53,20 @@ impl<'_> File<'_> {
         ])
     }
 
-    fn is_compressed(&self) -> bool {
+    pub fn is_compressed(&self) -> bool {
         self.extension_is_one_of( &[
             "zip", "tar", "Z", "gz", "bz2", "a", "ar", "7z",
             "iso", "dmg", "tc", "rar", "par"
         ])
     }
 
-    fn is_temp(&self) -> bool {
+    pub fn is_temp(&self) -> bool {
         self.name.ends_with("~")
             || (self.name.starts_with("#") && self.name.ends_with("#"))
             || self.extension_is_one_of( &[ "tmp", "swp", "swo", "swn", "bak" ])
     }
 
-    fn is_compiled(&self) -> bool {
+    pub fn is_compiled(&self) -> bool {
         if self.extension_is_one_of( &[ "class", "elc", "hi", "o", "pyc" ]) {
             true
         }