Also it's generally not recommended to use unwrap() in production code. use error handling by using the Result<T, E> type as your return type or use expect where needed
pub async fn new(init_endpoint: Option<String>, logs_endpoint: Option<String>) -> Self {
let client = Client::new();
let service_name = env::var("SERVICE_NAME").unwrap_or_else(|_| env::current_exe().unwrap().file_name().unwrap().to_str().unwrap().to_owned());
let environment = env::var("ENVIRONMENT").unwrap_or_else(|_| "development".to_owned());
let service_type = env::var("SERVICE_TYPE").unwrap_or_else(|_| "service".to_owned());
...rest of function...
Could you shed some more light on why you used unwrap here? i would recommend you use a custom error type enum perhaps with variants that explain why the method returned an error
Also it's generally not recommended to use unwrap() in production code. use error handling by using the Result<T, E> type as your return type or use expect where needed
Could you shed some more light on why you used unwrap here? i would recommend you use a custom error type enum perhaps with variants that explain why the method returned an error