I am trying to write a function to get my app setting from postgres database and I am using tokio_postgres
my function signature is
async fn get_setting<T:From<&postgres::Row>>(&self,k:T)->Result<Option<T>...>
And in the end of my execution which returns a Option I do
... .map(|r| r.map(|ref rw| rw.into()))
As far as my reasoning can go compiler should really not care about the lifetime of the Row (rw) since It only should exists up to the moment I call
I am not passing it around or something So why my function does not compile and asks for the lifetime
and How can I declare lifetime for that ?