Skip to content

Commit 33f43e3

Browse files
authored
Various clippy lint fixes
* Remove redudant `.into_iter()` and references. * Replace `#[cfg(all(x))]` with `#[cfg(x)]`
1 parent b9f18f4 commit 33f43e3

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

libffi-rs/src/middle/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl Builder {
9090
where
9191
I: IntoIterator<Item = Type>,
9292
{
93-
self.args.extend(types.into_iter());
93+
self.args.extend(types);
9494
self
9595
}
9696

libffi-rs/src/middle/types.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ unsafe fn ffi_type_clone(old: Type_) -> Owned<Type_> {
156156
size,
157157
..
158158
} = *old;
159-
let new = ffi_type_struct_create_raw(ffi_type_array_clone(elements), size, alignment);
160-
new
159+
ffi_type_struct_create_raw(ffi_type_array_clone(elements), size, alignment)
161160
} else {
162161
old
163162
}

libffi-sys-rs/build/not_msvc.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn build_and_link() {
4242
Command::new("make")
4343
.env_remove("DESTDIR")
4444
.arg("install")
45-
.current_dir(&build_dir),
45+
.current_dir(build_dir),
4646
);
4747

4848
// Cargo linking directives
@@ -109,7 +109,7 @@ pub fn configure_libffi(prefix: PathBuf, build_dir: &Path) {
109109
command.env(k, v);
110110
}
111111

112-
command.current_dir(&build_dir);
112+
command.current_dir(build_dir);
113113

114114
if cfg!(windows) {
115115
// When using MSYS2, OUT_DIR will be a Windows like path such as
@@ -124,7 +124,7 @@ pub fn configure_libffi(prefix: PathBuf, build_dir: &Path) {
124124
.to_str()
125125
.unwrap()
126126
.replace(":\\", "/")
127-
.replace("\\", "/");
127+
.replace('\\', "/");
128128

129129
msys_prefix.insert(0, '/');
130130

libffi-sys-rs/src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -119,23 +119,23 @@ pub struct ffi_cif {
119119
pub is_variadic: c_uint,
120120
#[cfg(all(target_arch = "aarch64", target_vendor = "apple"))]
121121
pub aarch64_nfixedargs: c_uint,
122-
#[cfg(all(target_arch = "arm"))]
122+
#[cfg(target_arch = "arm")]
123123
pub vfp_used: c_int,
124-
#[cfg(all(target_arch = "arm"))]
124+
#[cfg(target_arch = "arm")]
125125
pub vfp_reg_free: c_ushort,
126-
#[cfg(all(target_arch = "arm"))]
126+
#[cfg(target_arch = "arm")]
127127
pub vfp_nargs: c_ushort,
128-
#[cfg(all(target_arch = "arm"))]
128+
#[cfg(target_arch = "arm")]
129129
pub vfp_args: [c_schar; 16],
130130
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
131131
pub nfixedargs: c_uint,
132132
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
133133
pub riscv_nfixedargs: c_uint,
134134
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
135135
pub riscv_unused: c_uint,
136-
#[cfg(all(target_arch = "loongarch64"))]
136+
#[cfg(target_arch = "loongarch64")]
137137
pub loongarch_nfixedargs: c_uint,
138-
#[cfg(all(target_arch = "loongarch64"))]
138+
#[cfg(target_arch = "loongarch64")]
139139
pub loongarch_unused: c_uint,
140140
#[cfg(any(
141141
target_arch = "mips",

0 commit comments

Comments
 (0)