You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
actix / actix-web Public
I have a borrowing compile error.
Do you have any idea of what is going wrong?
use actix_web::web; use serde::Deserialize; use std::str; #[derive(Debug, Deserialize, Clone)] pub struct Params q: String, > pub fn parse'a, T>(query: &'a str) -> ResultT, std::io::Error> where T: Deserialize'a>, let params = web::Query::Params>::from_query(query).unwrap(); let base64_buf = base64::decode(¶ms.q).unwrap(); let to_string = str::from_utf8(&base64_buf).unwrap(); // ERROR => base64_buf does not live enough borrowed value does not live long enough let file_ref: T = serde_json::from_str(to_string).unwrap(); Ok(file_ref) >
Beta Was this translation helpful? Give feedback.
1 You must be logged in to vote
All reactionsIt works after changing T: Deserialize, by T: DeserializeOwned, .
Used serde::de::DeserializeOwned