comparison rust/hg-core/src/vfs.rs @ 52314:33d8cb64e9da

rust: fix darwin build
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Mon, 18 Nov 2024 15:42:09 +0100
parents a876ab6c3fd5
children
comparison
equal deleted inserted replaced
52313:56e8841a454c 52314:33d8cb64e9da
35 *UMASK.get_or_init(|| unsafe { 35 *UMASK.get_or_init(|| unsafe {
36 // TODO is there any way of getting the umask without temporarily 36 // TODO is there any way of getting the umask without temporarily
37 // setting it? Doesn't this affect all threads in this tiny window? 37 // setting it? Doesn't this affect all threads in this tiny window?
38 let mask = libc::umask(0); 38 let mask = libc::umask(0);
39 libc::umask(mask); 39 libc::umask(mask);
40 mask & 0o777 40 #[allow(clippy::useless_conversion)]
41 (mask & 0o777).into()
41 }) 42 })
42 } 43 }
43 44
44 /// Return the (unix) mode with which we will create/fix files 45 /// Return the (unix) mode with which we will create/fix files
45 fn get_mode(base: impl AsRef<Path>) -> Option<u32> { 46 fn get_mode(base: impl AsRef<Path>) -> Option<u32> {