mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 19:03:38 +08:00
Use bitflags contains() instead of intersects()
`intersects()` is "any of" while `contains()` is "all of" and while it makes no difference when testing a single bit, I believe `contains()` is less brittle for future maintenance and updates as its meaning is clearer. </pedantic>
This commit is contained in:
parent
6ed4d09c93
commit
6f9f9ee400
|
@ -447,7 +447,7 @@ impl EnvUniversal {
|
|||
Err(nix::Error::EINTR) => continue,
|
||||
Err(err) => {
|
||||
if !O_EXLOCK.is_empty() {
|
||||
if flags.intersects(O_EXLOCK)
|
||||
if flags.contains(O_EXLOCK)
|
||||
&& [nix::Error::ENOTSUP, nix::Error::EOPNOTSUPP].contains(&err)
|
||||
{
|
||||
// Filesystem probably does not support locking. Give up on locking.
|
||||
|
|
|
@ -669,7 +669,7 @@ impl IoChain {
|
|||
self.push(Arc::new(IoFile::new(spec.fd, fd)));
|
||||
}
|
||||
Err(err) => {
|
||||
if oflags.intersects(OFlag::O_EXCL) && err == nix::Error::EEXIST {
|
||||
if oflags.contains(OFlag::O_EXCL) && err == nix::Error::EEXIST {
|
||||
FLOGF!(warning, NOCLOB_ERROR, spec.target);
|
||||
} else {
|
||||
if should_flog!(warning) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user