Skip to content

Commit 4f093f5

Browse files
committed
clippy suggestions
1 parent 28306d7 commit 4f093f5

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

capnp/src/introspect.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ pub struct RawBrandedStructSchema {
235235

236236
impl core::cmp::PartialEq for RawBrandedStructSchema {
237237
fn eq(&self, other: &Self) -> bool {
238-
self.generic as *const _ == other.generic as *const _
239-
&& self.field_types == other.field_types
238+
core::ptr::eq(self.generic, other.generic) && self.field_types == other.field_types
240239
// don't need to compare annotation_types.
241240
// that field is equal iff field_types is.
242241
}
@@ -270,7 +269,7 @@ pub struct RawEnumSchema {
270269

271270
impl core::cmp::PartialEq for RawEnumSchema {
272271
fn eq(&self, other: &Self) -> bool {
273-
self.encoded_node as *const _ == other.encoded_node as *const _
272+
::core::ptr::eq(self.encoded_node, other.encoded_node)
274273
}
275274
}
276275

capnp/src/schema.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ impl AnnotationList {
394394
}
395395

396396
pub fn get(self, index: u32) -> Annotation {
397-
let proto = self.annotations.get(index as u32);
397+
let proto = self.annotations.get(index);
398398
let ty = (self.get_annotation_type)(self.child_index, index);
399399
Annotation { proto, ty }
400400
}

0 commit comments

Comments
 (0)