Skip to content

Commit e1f9676

Browse files
committed
Generalize lifetime of CTLexerBuilder lrpar_config callback
1 parent 1f0a2ac commit e1f9676

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lrlex/src/lib/ctbuilder.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ where
226226
LexerTypesT::StorageT: Debug + Eq + Hash + ToTokens,
227227
usize: num_traits::AsPrimitive<LexerTypesT::StorageT>,
228228
{
229-
lrpar_config: Option<Box<dyn Fn(CTParserBuilder<LexerTypesT>) -> CTParserBuilder<LexerTypesT>>>,
229+
lrpar_config:
230+
Option<Box<dyn Fn(CTParserBuilder<LexerTypesT>) -> CTParserBuilder<LexerTypesT> + 'a>>,
230231
lexer_path: Option<PathBuf>,
231232
output_path: Option<PathBuf>,
232233
lexerkind: Option<LexerKind>,
@@ -313,9 +314,9 @@ where
313314
/// .lexer_in_src_dir("calc.l")?
314315
/// .build()?;
315316
/// ```
316-
pub fn lrpar_config<F>(mut self, config_func: F) -> Self
317+
pub fn lrpar_config<F: 'a>(mut self, config_func: F) -> Self
317318
where
318-
F: 'static + Fn(CTParserBuilder<LexerTypesT>) -> CTParserBuilder<LexerTypesT>,
319+
F: Fn(CTParserBuilder<LexerTypesT>) -> CTParserBuilder<LexerTypesT>,
319320
{
320321
self.lrpar_config = Some(Box::new(config_func));
321322
self

0 commit comments

Comments
 (0)