can someone help me with this? I've met this problem a lot of times.
//in lib
pub async fn run(&'static self, addr: String) -> Result<(), Box<dyn Error>> {
let listener = TcpListener::bind("127.0.0.1:8080").await?;
loop {
let (socket, _) = listener.accept().await?;
tokio::spawn(handle_connection(&self, socket));
}
}
//in main
App::new().run("".to_string());
// complains
//temporary value dropped while borrowed
//creates a temporary which is freed while still in use