@@ -19,7 +19,6 @@ use super::module::{Module, ModuleKind};
1919use super :: template:: { TemplateInstantiation , TemplateParameters } ;
2020use super :: traversal:: { self , Edge , ItemTraversal } ;
2121use super :: ty:: { FloatKind , Type , TypeKind } ;
22- use crate :: callbacks:: ParseCallbacks ;
2322use crate :: clang:: { self , Cursor } ;
2423use crate :: parse:: ClangItemParser ;
2524use crate :: BindgenOptions ;
@@ -619,14 +618,9 @@ If you encounter an error missing from this list, please file an issue or a PR!"
619618 )
620619 }
621620
622- /// Get the user-provided callbacks by reference, if any.
623- pub fn parse_callbacks ( & self ) -> impl Iterator < Item = & dyn ParseCallbacks > {
624- self . options ( ) . parse_callbacks . iter ( ) . map ( |cb| cb. as_ref ( ) )
625- }
626-
627621 /// Add another path to the set of included files.
628622 pub fn include_file ( & mut self , filename : String ) {
629- for cb in self . parse_callbacks ( ) {
623+ for cb in & self . options ( ) . parse_callbacks {
630624 cb. include_file ( & filename) ;
631625 }
632626 self . deps . insert ( filename) ;
@@ -2251,7 +2245,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
22512245 Some ( CanDerive :: No )
22522246 }
22532247 } else {
2254- self . options . parse_callbacks . iter ( ) . find_map ( |cb| {
2248+ self . options . last_callback ( |cb| {
22552249 cb. blocklisted_type_implements_trait (
22562250 name,
22572251 derive_trait,
0 commit comments