This commit is contained in:
Marc Planard 2023-10-14 23:29:18 +02:00
parent d8ee59b964
commit 72e310c101
1 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
use scraper::{Html,Selector};
use url::{Url,Host};
use url::Url;
use std::sync::{Arc,Mutex};
use tokio::task::JoinHandle;
use futures::future;
@ -14,10 +14,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.unwrap_or_else(|| "https://www.tmplab.org".to_string());
let links = get_links(addr.as_ref()).await?;
let addr = Url::parse(addr.as_ref())?;
let mut links : Vec<Url> = links.into_iter()
let links : Vec<Url> = links.into_iter()
.filter(| url | url.host() != addr.host())
.collect();
let links = Arc::new(Mutex::new(links));
let joins = (0..WORKERS)