From 948c1f212cab5d56e82e47fd8ff10f20ecbf847f Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Fri, 31 May 2024 15:12:23 +0200 Subject: Initial attempt doesn't work --- src/channels.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/channels.rs') diff --git a/src/channels.rs b/src/channels.rs index b89169f..fdb8844 100644 --- a/src/channels.rs +++ b/src/channels.rs @@ -20,9 +20,9 @@ pub struct Channels { pub channels: Vec, } -pub fn get_channels() -> Vec { +pub async fn get_channels() -> Vec { let url = "https://api.somafm.com/channels.json"; - let res = reqwest::blocking::get(url).unwrap().text().unwrap(); + let res = reqwest::get(url).await.unwrap().text().await.unwrap(); let channels: Channels = serde_json::from_str(&res).unwrap(); channels.channels } -- cgit v1.3.1