Skip to content

Commit d08ee2f

Browse files
committed
ci: fix lint clippy::duplicated_attributes
1 parent 243adb0 commit d08ee2f

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

src/sys/statfs.rs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ pub struct Statfs(type_of_statfs);
5151
type fs_type_t = u32;
5252
#[cfg(target_os = "android")]
5353
type fs_type_t = libc::c_ulong;
54-
#[cfg(all(target_os = "linux", target_arch = "s390x", not(target_env = "musl")))]
54+
#[cfg(all(
55+
target_os = "linux",
56+
target_arch = "s390x",
57+
not(target_env = "musl")
58+
))]
5559
type fs_type_t = libc::c_uint;
5660
#[cfg(all(target_os = "linux", target_env = "musl"))]
5761
type fs_type_t = libc::c_ulong;
@@ -71,6 +75,8 @@ type fs_type_t = libc::c_int;
7175
type fs_type_t = libc::__fsword_t;
7276

7377
/// Describes the file system type as known by the operating system.
78+
// false positive, see: https://github.com/rust-lang/rust-clippy/issues/12537
79+
#[allow(clippy::duplicated_attributes)]
7480
#[cfg(any(
7581
target_os = "freebsd",
7682
target_os = "android",
@@ -318,7 +324,11 @@ impl Statfs {
318324
}
319325

320326
/// Optimal transfer block size
321-
#[cfg(all(target_os = "linux", target_arch = "s390x", not(target_env = "musl")))]
327+
#[cfg(all(
328+
target_os = "linux",
329+
target_arch = "s390x",
330+
not(target_env = "musl")
331+
))]
322332
pub fn optimal_transfer_size(&self) -> u32 {
323333
self.0.f_bsize
324334
}
@@ -373,7 +383,11 @@ impl Statfs {
373383

374384
/// Size of a block
375385
// f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471
376-
#[cfg(all(target_os = "linux", target_arch = "s390x", not(target_env = "musl")))]
386+
#[cfg(all(
387+
target_os = "linux",
388+
target_arch = "s390x",
389+
not(target_env = "musl")
390+
))]
377391
pub fn block_size(&self) -> u32 {
378392
self.0.f_bsize
379393
}
@@ -454,7 +468,11 @@ impl Statfs {
454468
}
455469

456470
/// Maximum length of filenames
457-
#[cfg(all(target_os = "linux", target_arch = "s390x", not(target_env = "musl")))]
471+
#[cfg(all(
472+
target_os = "linux",
473+
target_arch = "s390x",
474+
not(target_env = "musl")
475+
))]
458476
pub fn maximum_name_length(&self) -> u32 {
459477
self.0.f_namelen
460478
}

src/sys/time.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ const fn zero_init_timespec() -> timespec {
1212
unsafe { std::mem::transmute([0u8; std::mem::size_of::<timespec>()]) }
1313
}
1414

15+
// false positive, see: https://github.com/rust-lang/rust-clippy/issues/12537
16+
#[allow(clippy::duplicated_attributes)]
1517
#[cfg(any(
1618
all(feature = "time", any(target_os = "android", target_os = "linux")),
1719
all(
18-
any(target_os = "freebsd", solarish, target_os = "netbsd"),
20+
any(
21+
target_os = "freebsd",
22+
solarish,
23+
target_os = "linux",
24+
target_os = "netbsd"
25+
),
1926
feature = "time",
2027
feature = "signal"
2128
)

0 commit comments

Comments
 (0)