Hi there, I am a newbie on rust, came across a problem on reqwest client
mod utils;
use reqwest::ClientBuilder;
use std::io::{self, Write};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("Initializing client:");
let client = match ClientBuilder::new().build() {
Ok(client) => {
println!("Done building reqwest client");
io::stdout().flush().unwrap();
client
},
Err(e) => {
eprintln!("Error creating HTTP client: {}", e); // Print the error message
println!("Error creating HTTP client: {:?}, Error Type: {:?}", e, e);
io::stderr().flush().unwrap();
// Box the `reqwest::Error` to match the expected `Box<dyn std::error::Error>` type
return Err(Box::new(e) as Box<dyn std::error::Error>);
}
};
println!("Done creating client:");
Ok(())
}
I noticed that the code is not printing out any messages from OK or Err. It only prints "Initializing client:." I cannot reproduce it locally on my Windows machine. Please let me know what could be wrong with this code.