diff options
-rw-r--r-- | src/commands/set_mode.rs | 3 | ||||
-rw-r--r-- | src/unix.rs | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/commands/set_mode.rs b/src/commands/set_mode.rs index ee7efd8..56be5e5 100644 --- a/src/commands/set_mode.rs +++ b/src/commands/set_mode.rs @@ -51,7 +51,8 @@ impl SetMode { let mut mode: u32 = 0; for (i, ch) in s.chars().enumerate() { if ch == LIBC_PERMISSION_VALS[i].1 { - mode |= LIBC_PERMISSION_VALS[i].0; + let val: u32 = LIBC_PERMISSION_VALS[i].0.into(); + mode |= val; } } unix::set_mode(entry.path.as_path(), mode); diff --git a/src/unix.rs b/src/unix.rs index b819843..0fd2b8a 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -87,7 +87,7 @@ pub fn set_mode(path: &Path, mode: u32) { if let Some(s) = os_path.to_str() { let svec: Vec<i8> = s.bytes().map(|ch| ch as i8).collect(); unsafe { - libc::chmod(svec.as_ptr(), mode); + libc::chmod(svec.as_ptr(), mode.into()); } } } |