Skip to content

Commit ea0f3b0

Browse files
committed
Fix formatting of cfg's within macros.
Rustfmt doesn't format everything within `bitflags` macros, so manually format `cfg`s for consistency with the rest of the codebase.
1 parent 2a70fd3 commit ea0f3b0

File tree

1 file changed

+59
-46
lines changed

1 file changed

+59
-46
lines changed

src/imp/libc/fs/types.rs

Lines changed: 59 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ bitflags! {
4949
const SYMLINK_NOFOLLOW = c::AT_SYMLINK_NOFOLLOW;
5050

5151
/// `AT_EMPTY_PATH`
52-
#[cfg(any(target_os = "android",
53-
target_os = "fuchsia",
54-
target_os = "linux"))]
52+
#[cfg(any(
53+
target_os = "android",
54+
target_os = "fuchsia",
55+
target_os = "linux",
56+
))]
5557
const EMPTY_PATH = c::AT_EMPTY_PATH;
5658

5759
/// `AT_EACCESS`
@@ -191,13 +193,15 @@ bitflags! {
191193
const EXCL = c::O_EXCL;
192194

193195
/// `O_FSYNC`
194-
#[cfg(any(target_os = "dragonfly",
195-
target_os = "freebsd",
196-
target_os = "ios",
197-
all(target_os = "linux", not(target_env = "musl")),
198-
target_os = "macos",
199-
target_os = "netbsd",
200-
target_os = "openbsd"))]
196+
#[cfg(any(
197+
target_os = "dragonfly",
198+
target_os = "freebsd",
199+
target_os = "ios",
200+
all(target_os = "linux", not(target_env = "musl")),
201+
target_os = "macos",
202+
target_os = "netbsd",
203+
target_os = "openbsd",
204+
))]
201205
const FSYNC = c::O_FSYNC;
202206

203207
/// `O_NOFOLLOW`
@@ -220,13 +224,14 @@ bitflags! {
220224
const NOCTTY = c::O_NOCTTY;
221225

222226
/// `O_RSYNC`
223-
#[cfg(any(target_os = "android",
224-
target_os = "emscripten",
225-
target_os = "linux",
226-
target_os = "netbsd",
227-
target_os = "openbsd",
228-
target_os = "wasi",
229-
))]
227+
#[cfg(any(
228+
target_os = "android",
229+
target_os = "emscripten",
230+
target_os = "linux",
231+
target_os = "netbsd",
232+
target_os = "openbsd",
233+
target_os = "wasi",
234+
))]
230235
const RSYNC = c::O_RSYNC;
231236

232237
/// `O_SYNC`
@@ -237,44 +242,52 @@ bitflags! {
237242
const TRUNC = c::O_TRUNC;
238243

239244
/// `O_PATH`
240-
#[cfg(any(target_os = "android",
241-
target_os = "emscripten",
242-
target_os = "fuchsia",
243-
target_os = "linux",
244-
target_os = "redox"))]
245+
#[cfg(any(
246+
target_os = "android",
247+
target_os = "emscripten",
248+
target_os = "fuchsia",
249+
target_os = "linux",
250+
target_os = "redox",
251+
))]
245252
const PATH = c::O_PATH;
246253

247254
/// `O_CLOEXEC`
248-
#[cfg(any(target_os = "android",
249-
target_os = "dragonfly",
250-
target_os = "emscripten",
251-
target_os = "freebsd",
252-
target_os = "fuchsia",
253-
target_os = "haiku",
254-
target_os = "hermit",
255-
target_os = "illumos",
256-
target_os = "ios",
257-
target_os = "linux",
258-
target_os = "macos",
259-
target_os = "netbsd",
260-
target_os = "openbsd",
261-
target_os = "redox",
262-
target_os = "solaris",
263-
target_os = "vxworks",
264-
target_os = "wasi"))]
255+
#[cfg(any(
256+
target_os = "android",
257+
target_os = "dragonfly",
258+
target_os = "emscripten",
259+
target_os = "freebsd",
260+
target_os = "fuchsia",
261+
target_os = "haiku",
262+
target_os = "hermit",
263+
target_os = "illumos",
264+
target_os = "ios",
265+
target_os = "linux",
266+
target_os = "macos",
267+
target_os = "netbsd",
268+
target_os = "openbsd",
269+
target_os = "redox",
270+
target_os = "solaris",
271+
target_os = "vxworks",
272+
target_os = "wasi",
273+
))]
265274
const CLOEXEC = c::O_CLOEXEC;
266275

267276
/// `O_TMPFILE`
268-
#[cfg(any(target_os = "android",
269-
target_os = "emscripten",
270-
target_os = "fuchsia",
271-
target_os = "linux"))]
277+
#[cfg(any(
278+
target_os = "android",
279+
target_os = "emscripten",
280+
target_os = "fuchsia",
281+
target_os = "linux",
282+
))]
272283
const TMPFILE = c::O_TMPFILE;
273284

274285
/// `O_NOATIME`
275-
#[cfg(any(target_os = "android",
276-
target_os = "fuchsia",
277-
target_os = "linux"))]
286+
#[cfg(any(
287+
target_os = "android",
288+
target_os = "fuchsia",
289+
target_os = "linux",
290+
))]
278291
const NOATIME = c::O_NOATIME;
279292
}
280293
}

0 commit comments

Comments
 (0)