Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
0x6e66 committed Feb 20, 2024
1 parent a08b066 commit 0fa4377
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
14 changes: 9 additions & 5 deletions examples/download_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ use pangaea::download_data::download_data_by_id;
#[tokio::main]
async fn main() {
download_zip().await;
download_txt().await;
download_txt().await;
}

async fn download_zip(){
async fn download_zip() {
let id = 921673;
download_data_by_id(id, None, "downloaded_file").await.unwrap();
download_data_by_id(id, None, "downloaded_file")
.await
.unwrap();
}

async fn download_txt(){
async fn download_txt() {
let id = 839111;
download_data_by_id(id, None, "downloaded_file").await.unwrap();
download_data_by_id(id, None, "downloaded_file")
.await
.unwrap();
}
6 changes: 3 additions & 3 deletions src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ pub fn get_elastic_client() -> Result<Elasticsearch> {

pub fn string_to_datetime(dt: String) -> Option<DateTime<Utc>> {
DateTime::parse_from_rfc3339(format!("{}+01:00", dt).as_str())
.ok()
.map(|dt| dt.to_utc())
}
.ok()
.map(|dt| dt.to_utc())
}

0 comments on commit 0fa4377

Please sign in to comment.