diff --git a/src/db.rs b/src/db.rs index 03a1850..b5e913a 100644 --- a/src/db.rs +++ b/src/db.rs @@ -8,7 +8,7 @@ use surrealdb::{ Surreal, }; use tokio::sync::Mutex; -use tracing::{error, instrument, trace, warn}; +use tracing::{error, instrument, trace}; use url::Url; use crate::Config; diff --git a/src/filesystem.rs b/src/filesystem.rs index 9a3f761..d95af58 100644 --- a/src/filesystem.rs +++ b/src/filesystem.rs @@ -8,7 +8,7 @@ use url::Url; pub async fn store(data: &str, url: &Url) { let path = PathBuf::from("./downloaded".to_string() + url.path()); let basepath = path.ancestors().skip(1).take(1).collect::(); - trace!("Built path: {:?} and base path: {:?}", &path, &basepath); + trace!("Save path: {:?} and base path: {:?}", &path, &basepath); if let Err(err) = fs::create_dir_all(&basepath).await { let ex = path.ancestors().fold(String::new(), |mut s, item| { s += ", "; diff --git a/src/main.rs b/src/main.rs index c5c96cd..399fe0a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,7 @@ extern crate html5ever; use std::{ - collections::HashSet, fs::File, io::Read, net::{IpAddr, Ipv4Addr}, str::FromStr, time + collections::HashSet, fs::File, io::Read, net::{IpAddr, Ipv4Addr} }; use db::{connect, Website}; diff --git a/src/parser.rs b/src/parser.rs index 49001e0..ac55bf0 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -5,7 +5,7 @@ use html5ever::tokenizer::{BufferQueue, TokenizerResult}; use html5ever::tokenizer::{StartTag, TagToken}; use html5ever::tokenizer::{Token, TokenSink, TokenSinkResult, Tokenizer, TokenizerOpts}; use html5ever::{local_name, tendril::*}; -use tracing::{debug, error, info, instrument, trace, warn}; +use tracing::{debug, error, instrument, trace, warn}; use url::Url; use crate::db::Website; @@ -41,7 +41,7 @@ impl TokenSink for Website { Some(ok) }, Err(e) => { - if attr.value.eq(&Tendril::from_char('#')) { + if attr.value.starts_with('#') { trace!("Rejecting # url"); None } else {