Skip to content

Commit

Permalink
version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
ddboline committed May 12, 2024
1 parent e657332 commit 1ac680f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion garmin_http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"

[dependencies]
anyhow = "1.0"
authorized_users = { git = "https://github.com/ddboline/auth_server_rust.git", tag="0.11.13"}
authorized_users = { git = "https://github.com/ddboline/auth_server_rust.git", tag="0.11.14"}
base64 = "0.22"
cookie = {version="0.18", features=["percent-encode"]}
derive_more = "0.99"
Expand Down
20 changes: 11 additions & 9 deletions garmin_utils/src/garmin_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,15 @@ fn extract_zip(filename: &Path, ziptmpdir: &Path) -> Result<Vec<PathBuf>, Error>
));
}
let mut zip = ZipArchive::new(File::open(filename)?)?;
(0..zip.len()).map(|i| {
let mut f = zip.by_index(i)?;
let fpath = ziptmpdir.join(f.name());
let mut g = File::create(&fpath)?;
std::io::copy(&mut f, &mut g)?;
Ok(fpath)
}).collect()
(0..zip.len())
.map(|i| {
let mut f = zip.by_index(i)?;
let fpath = ziptmpdir.join(f.name());
let mut g = File::create(&fpath)?;
std::io::copy(&mut f, &mut g)?;
Ok(fpath)
})
.collect()
}

/// # Errors
Expand Down Expand Up @@ -364,8 +366,8 @@ pub fn get_random_string() -> StackString {
#[cfg(test)]
mod tests {
use anyhow::Error;
use tempdir::TempDir;
use std::path::Path;
use tempdir::TempDir;

use crate::garmin_util::extract_zip;

Expand All @@ -380,4 +382,4 @@ mod tests {
assert!(files.len() == 2);
Ok(())
}
}
}
10 changes: 7 additions & 3 deletions strava_lib/src/strava_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ mod tests {
use futures::{future::try_join_all, TryStreamExt};
use log::debug;
use std::collections::HashMap;
use time::{OffsetDateTime, Duration};
use time::{Duration, OffsetDateTime};

use garmin_lib::garmin_config::GarminConfig;
use garmin_utils::{garmin_util::get_md5sum, pgpool::PgPool, sport_types::SportTypes};
Expand All @@ -821,7 +821,9 @@ mod tests {
let start_datetime = Some(OffsetDateTime::now_utc() - Duration::days(15));
let end_datetime = Some(OffsetDateTime::now_utc());

let activities = client.get_all_strava_activites(start_datetime, end_datetime).await?;
let activities = client
.get_all_strava_activites(start_datetime, end_datetime)
.await?;
assert!(activities.len() > 10);
Ok(())
}
Expand All @@ -835,7 +837,9 @@ mod tests {
let start_datetime = Some(OffsetDateTime::now_utc() - Duration::days(15));
let end_datetime = Some(OffsetDateTime::now_utc());

let activities = client.get_all_strava_activites(start_datetime, end_datetime).await?;
let activities = client
.get_all_strava_activites(start_datetime, end_datetime)
.await?;
if let Some(activity) = activities.into_iter().nth(0) {
debug!("{} {}", activity.id, activity.name);
let result = client
Expand Down

0 comments on commit 1ac680f

Please sign in to comment.