From 6b6bafe6e03f30db65e253a1647e9401770f25ad Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 15 Aug 2022 19:06:36 +0200 Subject: [PATCH] return data --- src/info.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/info.rs b/src/info.rs index 12c1f9d..69eb420 100644 --- a/src/info.rs +++ b/src/info.rs @@ -1,10 +1,10 @@ use std::collections::HashMap; -use chrono::{Duration, TimeZone, Utc}; +use chrono::{DateTime, Duration, TimeZone, Utc}; use regex::{Captures, Regex}; use scraper::{Html, Selector}; -pub async fn info() { +pub async fn info() -> HashMap, DateTime)>> { let document = get_webpage().await.expect("Can't reach info website."); // Selectors @@ -57,7 +57,7 @@ pub async fn info() { } } - println!("{:#?}", data); + data } /// Get info webpage @@ -100,7 +100,7 @@ fn anglophonization(date: &str) -> String { } /// Turn a string to a DateTime -fn get_date(date: &str) -> chrono::DateTime { +fn get_date(date: &str) -> DateTime { // Use and keep UTC time, we have the hour set to 12h and // Paris 8 is in France so there is no problems Utc.datetime_from_str(&anglophonization(date), "%e %B %Y %H:%M")