Shit doesn't fucking work
This commit is contained in:
parent
0e40cff968
commit
f6da9ed03b
1 changed files with 18 additions and 16 deletions
|
@ -35,7 +35,9 @@ pub async fn parse_head(
|
|||
url: &Url,
|
||||
mut body: impl Stream<Item = Result<Vec<u8>, String>> + Unpin,
|
||||
) -> Result<Vec<Icon>, Box<dyn Error>> {
|
||||
let mut icons = Vec::new();
|
||||
let mut icons: Vec<
|
||||
futures::future::Shared<std::pin::Pin<Box<dyn std::future::Future<Output = Vec<Icon>> + Send>>>,
|
||||
> = Vec::new();
|
||||
let new_icons = Arc::new(Mutex::new(Vec::new()));
|
||||
|
||||
{
|
||||
|
@ -52,11 +54,11 @@ pub async fn parse_head(
|
|||
.get_attribute("href")
|
||||
.and_then(|href| url.join(&href).ok())
|
||||
{
|
||||
new_icons.lock().unwrap().push(
|
||||
async { SiteIcons::load_manifest(href).await.unwrap_or(Vec::new()) }
|
||||
.boxed()
|
||||
.shared(),
|
||||
)
|
||||
// new_icons.lock().unwrap().push(
|
||||
// async { SiteIcons::load_manifest(href).await.unwrap_or(Vec::new()) }
|
||||
// .boxed()
|
||||
// .shared(),
|
||||
// )
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
@ -83,16 +85,16 @@ pub async fn parse_head(
|
|||
|
||||
let sizes = link.get_attribute("sizes");
|
||||
|
||||
new_icons.lock().unwrap().push(
|
||||
async {
|
||||
Icon::load(href, kind, sizes)
|
||||
.await
|
||||
.map(|icon| vec![icon])
|
||||
.unwrap_or(Vec::new())
|
||||
}
|
||||
.boxed()
|
||||
.shared(),
|
||||
)
|
||||
// new_icons.lock().unwrap().push(
|
||||
// async {
|
||||
// Icon::load(href, kind, sizes)
|
||||
// .await
|
||||
// .map(|icon| vec![icon])
|
||||
// .unwrap_or(Vec::new())
|
||||
// }
|
||||
// .boxed()
|
||||
// .shared(),
|
||||
// )
|
||||
};
|
||||
|
||||
Ok(())
|
||||
|
|
Reference in a new issue