@@ -148,9 +148,7 @@ fn check_trait_items(cx: &LateContext<'_, '_>, visited_trait: &Item, trait_items
148
148
}
149
149
}
150
150
151
- let trait_node_id = cx. tcx . hir ( ) . hir_to_node_id ( visited_trait. hir_id ) ;
152
-
153
- if cx. access_levels . is_exported ( trait_node_id) && trait_items. iter ( ) . any ( |i| is_named_self ( cx, i, "len" ) ) {
151
+ if cx. access_levels . is_exported ( visited_trait. hir_id ) && trait_items. iter ( ) . any ( |i| is_named_self ( cx, i, "len" ) ) {
154
152
let mut current_and_super_traits = FxHashSet :: default ( ) ;
155
153
let visited_trait_def_id = cx. tcx . hir ( ) . local_def_id_from_hir_id ( visited_trait. hir_id ) ;
156
154
fill_trait_set ( visited_trait_def_id, & mut current_and_super_traits, cx) ;
@@ -193,10 +191,7 @@ fn check_impl_items(cx: &LateContext<'_, '_>, item: &Item, impl_items: &[ImplIte
193
191
}
194
192
195
193
let is_empty = if let Some ( is_empty) = impl_items. iter ( ) . find ( |i| is_named_self ( cx, i, "is_empty" ) ) {
196
- if cx
197
- . access_levels
198
- . is_exported ( cx. tcx . hir ( ) . hir_to_node_id ( is_empty. id . hir_id ) )
199
- {
194
+ if cx. access_levels . is_exported ( is_empty. id . hir_id ) {
200
195
return ;
201
196
} else {
202
197
"a private"
@@ -206,7 +201,7 @@ fn check_impl_items(cx: &LateContext<'_, '_>, item: &Item, impl_items: &[ImplIte
206
201
} ;
207
202
208
203
if let Some ( i) = impl_items. iter ( ) . find ( |i| is_named_self ( cx, i, "len" ) ) {
209
- if cx. access_levels . is_exported ( cx . tcx . hir ( ) . hir_to_node_id ( i. id . hir_id ) ) {
204
+ if cx. access_levels . is_exported ( i. id . hir_id ) {
210
205
let def_id = cx. tcx . hir ( ) . local_def_id_from_hir_id ( item. hir_id ) ;
211
206
let ty = cx. tcx . type_of ( def_id) ;
212
207
0 commit comments