QueryBuilderImpl<'a>::expr improperly ties the lifetime of the expr argument to the lifetime of the QueryBuilderImpl instance, despite not accessing the argument outside the scope of the function. This makes using the API with non-static query expressions difficult/impossible. E.g. this:
pub trait QueryBuilderImpl<'a>: TermBuilderImpl<'a> {
fn expr(&mut self, expr: &'a str) -> &mut Self { // <-- improper use of &'a
let expr = ManuallyDrop::new(format!("{expr}\0"));
...
}
}
Should be:
pub trait QueryBuilderImpl<'a>: TermBuilderImpl<'a> {
fn expr(&mut self, expr: &str) -> &mut Self { // <--
let expr = ManuallyDrop::new(format!("{expr}\0"));
...
}
}
QueryBuilderImpl<'a>::exprimproperly ties the lifetime of theexprargument to the lifetime of theQueryBuilderImplinstance, despite not accessing the argument outside the scope of the function. This makes using the API with non-static query expressions difficult/impossible. E.g. this:Should be: