dead code removal

This commit is contained in:
Oliver 2025-03-21 06:03:34 +00:00
parent 66581cc453
commit a23429104c
4 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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::<PathBuf>();
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 += ", ";

View File

@ -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};

View File

@ -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 {