summaryrefslogtreecommitdiff
path: root/src/codegen/impl_partialeq.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen/impl_partialeq.rs')
-rw-r--r--src/codegen/impl_partialeq.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/codegen/impl_partialeq.rs b/src/codegen/impl_partialeq.rs
index 5a1ba3fe..960306ff 100644
--- a/src/codegen/impl_partialeq.rs
+++ b/src/codegen/impl_partialeq.rs
@@ -2,7 +2,6 @@ use crate::ir::comp::{CompInfo, CompKind, Field, FieldMethods};
use crate::ir::context::BindgenContext;
use crate::ir::item::{IsOpaque, Item};
use crate::ir::ty::{TypeKind, RUST_DERIVE_IN_ARRAY_LIMIT};
-use proc_macro2;
/// Generate a manual implementation of `PartialEq` trait for the
/// specified compound type.
@@ -51,7 +50,7 @@ pub fn gen_partialeq_impl(
}
Field::Bitfields(ref bu) => {
for bitfield in bu.bitfields() {
- if let Some(_) = bitfield.name() {
+ if bitfield.name().is_some() {
let getter_name = bitfield.getter_name();
let name_ident = ctx.rust_ident_raw(getter_name);
tokens.push(quote! {
@@ -104,7 +103,7 @@ fn gen_field(
TypeKind::Opaque => quote_equals(name_ident),
TypeKind::TemplateInstantiation(ref inst) => {
- if inst.is_opaque(ctx, &ty_item) {
+ if inst.is_opaque(ctx, ty_item) {
quote! {
&self. #name_ident [..] == &other. #name_ident [..]
}