Skip to content

Commit 744ca5e

Browse files
mattsu2020sylvestre
authored andcommitted
refactor: remove unnecessary return statements in get_umask function
Simplified the get_umask function by removing explicit return statements and using implicit returns instead, improving code readability and following Rust idioms.
1 parent 2ede1ea commit 744ca5e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/uucore/src/lib/features/mode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ pub fn get_umask() -> u32 {
182182

183183
let mask = umask(Mode::empty());
184184
let _ = umask(mask);
185-
return mask.bits() as u32;
185+
mask.bits() as u32
186186
}
187187

188188
#[cfg(not(unix))]
@@ -191,7 +191,7 @@ pub fn get_umask() -> u32 {
191191
// possible but it can't violate Rust's guarantees.
192192
let mask = unsafe { umask(0) };
193193
unsafe { umask(mask) };
194-
return mask as u32;
194+
mask as u32
195195
}
196196
}
197197

0 commit comments

Comments
 (0)