From b36066bbcd474902c771fa4154d9cffcc279a6cd Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Tue, 10 Jun 2025 16:34:38 -0700 Subject: [PATCH] Run clippy fix --- native/src/base/files.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/native/src/base/files.rs b/native/src/base/files.rs index b792c89b6..711a07e2d 100644 --- a/native/src/base/files.rs +++ b/native/src/base/files.rs @@ -325,12 +325,11 @@ impl Utf8CStr { pub fn set_attr<'a>(&'a self, attr: &'a FileAttr) -> OsResult<'a, ()> { unsafe { - if !attr.is_symlink() { - if libc::chmod(self.as_ptr(), (attr.st.st_mode & 0o777).as_()) < 0 { - let self_attr = self.get_attr()?; - if !self_attr.is_symlink() { - return Err(OsError::last_os_error("chmod", Some(self), None)); - } + if !attr.is_symlink() && libc::chmod(self.as_ptr(), (attr.st.st_mode & 0o777).as_()) < 0 + { + let self_attr = self.get_attr()?; + if !self_attr.is_symlink() { + return Err(OsError::last_os_error("chmod", Some(self), None)); } } libc::lchown(self.as_ptr(), attr.st.st_uid, attr.st.st_gid).check_os_err(