Skip to content

Commit

Permalink
Move current inside
Browse files Browse the repository at this point in the history
  • Loading branch information
chipsenkbeil committed May 27, 2023
1 parent 7a07082 commit 4c8e470
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions distant-core/src/api/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,6 @@ impl DistantApi for LocalDistantApi {
})?
.permissions();

// Create current permissions from std permissions
let mut current = Permissions::from(std_permissions.clone());

// Apply the readonly flag for all platforms
if let Some(readonly) = permissions.is_readonly() {
std_permissions.set_readonly(readonly);
Expand All @@ -448,6 +445,7 @@ impl DistantApi for LocalDistantApi {
#[cfg(unix)]
{
use std::os::unix::prelude::*;
let mut current = Permissions::from(std_permissions.clone());
current.apply_from(permissions);
std_permissions.set_mode(current.to_unix_mode());
}
Expand Down

0 comments on commit 4c8e470

Please sign in to comment.