Skip to content

Commit ff54449

Browse files
committed
testing file downloading
1 parent 3d1c81c commit ff54449

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
use crate::getting_weather::{get_url, get_weather, Location};
2+
use std::io;
3+
use std::fs::File;
4+
use std::io::Write;
25

36
pub mod getting_weather;
47
#[tokio::main]
58
async fn main() -> Result<(), Box<dyn std::error::Error>> {
9+
let resp = reqwest::Client::new().get("https://raw.githubusercontent.com/Detalexpl/TuiWeather/refs/heads/master/worldcities.csv").send().await?.text().await?;
10+
let mut file = File::create("path")?;
11+
file.write_all(resp.as_bytes())?;
612
let location = Location{
713
latitude:52.22,
814
longitude:21.01

0 commit comments

Comments
 (0)