Return Future value from a function
问题 I recently started to learn Rust and I'm not sure how I can return future value from a function that should return a Result. When I try to return just the response variable and remove the Result output, I get an error: cannot use the ? operator in a function that returns std::string::String #[tokio::main] async fn download() -> Result<(),reqwest::Error> { let url = "https://query1.finance.yahoo.com/v8/finance/chart/TSLA"; let response = reqwest::get(url) .await? .text() .await?; Ok(response)