// use std::collections::HashSet; use crate::model::Config; use anyhow::Result; use super::Issue; pub async fn fetch_open_issues<'net, 'fs>(config: &Config<'net, 'fs>) -> Result> { let server_url = config.server(); let repo = config.repo(); let url = format!("{server_url}/api/v1/repos/{repo}/issues?state=open"); let net = config.net(); let client = net.client(); let request = client.get(url); let request = if let Some(auth_token) = config.auth_token() { request.header("Authorization", auth_token) } else { request }; // .build(); let response = net.send(request).await?; let issues: HashSet = response.json().await?; Ok(issues) }