I am trying to work with Data in acitx web, but it wont work with a defined lifetime. Why am i getting this error and how do i fix it? implicit elided lifetime not allowed here assuming a 'static lifetime
#[get("/search/{query}/")]
async fn testing(search: Path<SearchIdentifier>,test: Data< Test >) -> Json<String> {...}
error[E0726]: implicit elided lifetime not allowed here
--> src/api/file.rs:86:62
|
86 | async fn testing(search: Path<SearchIdentifier>,test: Data< Test >) -> Json<String> {
| ^^^^^^- help: indicate the anonymous lifetime: `<'_>`
|
= note: assuming a `'static` lifetime...
pub struct Test<'a> {
test: Test<'a>,
}
impl<'a> Test<'a> {
pub fn new(conn: MysqlConnection) -> Self {
let test = Test { conn: &conn };
Self {test}
}