mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-12 06:41:14 -03: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:
@@ -447,7 +447,7 @@ fn open_and_acquire_lock(&mut self) -> Option<File> {
|
||||
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 @@ pub fn append_from_specs(&mut self, specs: &RedirectionSpecList, pwd: &wstr) ->
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user