Run rustfmt and fix some clippy lints
This commit is contained in:
@@ -49,7 +49,7 @@ impl TogglApiClient {
|
||||
}
|
||||
|
||||
pub fn new(workspace_id: &str, api_token: &str) -> Self {
|
||||
let toggl_auth = &STANDARD.encode(&format!("{}:api_token", api_token));
|
||||
let toggl_auth = &STANDARD.encode(format!("{}:api_token", api_token));
|
||||
|
||||
let client = Client::builder()
|
||||
.default_headers(Self::default_headers(toggl_auth))
|
||||
@@ -107,7 +107,8 @@ impl TogglApiClient {
|
||||
pub async fn fetch_recent_time_entries(&self) -> crate::Result<Vec<TimeEntry>> {
|
||||
let url = format!("{base_url}/me/time_entries", base_url = self.base_url);
|
||||
|
||||
Ok(self.make_request(self.client.get(url))
|
||||
Ok(self
|
||||
.make_request(self.client.get(url))
|
||||
.await?
|
||||
.json::<Vec<TimeEntry>>()
|
||||
.await?)
|
||||
@@ -132,7 +133,8 @@ impl TogglApiClient {
|
||||
|
||||
pub async fn fetch_time_entries_in_range(
|
||||
&self,
|
||||
start: DateTime<Utc>, end: DateTime<Utc>,
|
||||
start: DateTime<Utc>,
|
||||
end: DateTime<Utc>,
|
||||
) -> crate::Result<Vec<TimeEntry>> {
|
||||
let url = format!("{base_url}/me/time_entries", base_url = self.base_url);
|
||||
|
||||
@@ -211,7 +213,7 @@ impl TogglApiClient {
|
||||
.make_request(
|
||||
self.client
|
||||
.post(&url)
|
||||
.json(&Self::paginate_filters(&filters, last_row_number_n)),
|
||||
.json(&Self::paginate_filters(filters, last_row_number_n)),
|
||||
)
|
||||
.await?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user