Skip to content

Commit

Permalink
πŸ’… cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
shantanuraj committed Dec 12, 2023
1 parent e24659e commit 7761349
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
19 changes: 10 additions & 9 deletions src/api/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ impl V9ApiClient {
let header_content =
"Basic ".to_string() + general_purpose::STANDARD.encode(auth_string).as_str();
let mut headers = header::HeaderMap::new();
let auth_header = header::HeaderValue::from_str(header_content.as_str()).expect("Invalid header value");
let auth_header =
header::HeaderValue::from_str(header_content.as_str()).expect("Invalid header value");
headers.insert(header::AUTHORIZATION, auth_header);

let base_client = Client::builder().default_headers(headers);
Expand All @@ -77,7 +78,8 @@ impl V9ApiClient {
base_client
}
}
.build().expect("Couldn't build a http client");
.build()
.expect("Couldn't build a http client");
let api_client = Self {
http_client,
base_url: "https://track.toggl.com/api/v9".to_string(),
Expand Down Expand Up @@ -140,13 +142,12 @@ impl ApiClient for V9ApiClient {
}

async fn get_entities(&self) -> ResultWithDefaultError<Entities> {
let (network_time_entries, network_projects, network_tasks, network_clients) =
tokio::join!(
self.get_time_entries(),
self.get_projects(),
self.get_tasks(),
self.get_clients(),
);
let (network_time_entries, network_projects, network_tasks, network_clients) = tokio::join!(
self.get_time_entries(),
self.get_projects(),
self.get_tasks(),
self.get_clients(),
);

let clients: HashMap<i64, crate::models::Client> = network_clients
.unwrap_or_default()
Expand Down
3 changes: 2 additions & 1 deletion src/commands/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ impl AuthenticationCommand {
"{} {}",
AUTH_SUCCEEDED_MESSAGE.green(),
user.email.green().bold(),
).expect("failed to write to stdout");
)
.expect("failed to write to stdout");

Ok(())
}
Expand Down
16 changes: 9 additions & 7 deletions src/config/manage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ impl ConfigManageCommand {

if delete {
return {
fs::remove_file(path).map(|_| {
println!(
"{} {}",
"Config file deleted from".red().bold(),
display_path
);
}).expect("failed to delete config");
fs::remove_file(path)
.map(|_| {
println!(
"{} {}",
"Config file deleted from".red().bold(),
display_path
);
})
.expect("failed to delete config");
Ok(())
};
}
Expand Down

0 comments on commit 7761349

Please sign in to comment.