Skip to content

Commit

Permalink
Remove warnings on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sam701 committed Oct 15, 2019
1 parent e40a218 commit 65b56d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::{env, fs};
use std::fs::{Permissions};
use std::env;
use std::path::PathBuf;


Expand All @@ -11,9 +10,10 @@ pub fn path_to_absolute(path: &str) -> PathBuf {

#[cfg(target_family = "unix")]
pub fn set_permissions(path: &PathBuf, mode: u32) {
use std::fs::{self, Permissions};
use std::os::unix::fs::PermissionsExt;
fs::set_permissions(path, Permissions::from_mode(mode)).expect("set file permissions");
}

#[cfg(target_family = "windows")]
pub fn set_permissions(path: &PathBuf, mode: u32) {}
pub fn set_permissions(_path: &PathBuf, _mode: u32) {}

0 comments on commit 65b56d2

Please sign in to comment.