diff --git a/lrlex/src/lib/ctbuilder.rs b/lrlex/src/lib/ctbuilder.rs index 63c74066e..788ca782d 100644 --- a/lrlex/src/lib/ctbuilder.rs +++ b/lrlex/src/lib/ctbuilder.rs @@ -248,7 +248,7 @@ where show_warnings: bool, header: Header, #[cfg(test)] - inspect_lexerkind_cb: Option Result<(), Box>>>, + inspect_lexerkind_cb: Option Result<(), Box>>>, } impl CTLexerBuilder<'_, DefaultLexerTypes> { @@ -509,7 +509,7 @@ where }; #[cfg(test)] if let Some(inspect_lexerkind_cb) = self.inspect_lexerkind_cb { - inspect_lexerkind_cb(lexerkind)? + inspect_lexerkind_cb(&lexerkind)? } let (lexerdef, lex_flags): (LRNonStreamingLexerDef, LexFlags) = match lexerkind { @@ -1211,7 +1211,7 @@ where #[cfg(test)] pub fn inspect_lexerkind( mut self, - cb: Box Result<(), Box>>, + cb: Box Result<(), Box>>, ) -> Self { self.inspect_lexerkind_cb = Some(cb); self @@ -1481,7 +1481,7 @@ mod test { .output_path(format!("{}.rs", lex_path.clone())) .lexer_path(lex_path.clone()) .inspect_lexerkind(Box::new(move |lexerkind| { - assert!(matches!(lexerkind, LexerKind::LRNonStreamingLexer)); + assert!(matches!(lexerkind, &LexerKind::LRNonStreamingLexer)); Ok(()) })) .build()