dead code removal
This commit is contained in:
		@@ -8,7 +8,7 @@ use surrealdb::{
 | 
				
			|||||||
    Surreal,
 | 
					    Surreal,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
use tokio::sync::Mutex;
 | 
					use tokio::sync::Mutex;
 | 
				
			||||||
use tracing::{error, instrument, trace, warn};
 | 
					use tracing::{error, instrument, trace};
 | 
				
			||||||
use url::Url;
 | 
					use url::Url;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use crate::Config;
 | 
					use crate::Config;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,7 @@ use url::Url;
 | 
				
			|||||||
pub async fn store(data: &str, url: &Url) {
 | 
					pub async fn store(data: &str, url: &Url) {
 | 
				
			||||||
    let path = PathBuf::from("./downloaded".to_string() + url.path());
 | 
					    let path = PathBuf::from("./downloaded".to_string() + url.path());
 | 
				
			||||||
    let basepath = path.ancestors().skip(1).take(1).collect::<PathBuf>();
 | 
					    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 {
 | 
					    if let Err(err) = fs::create_dir_all(&basepath).await {
 | 
				
			||||||
        let ex = path.ancestors().fold(String::new(), |mut s, item| {
 | 
					        let ex = path.ancestors().fold(String::new(), |mut s, item| {
 | 
				
			||||||
            s += ", ";
 | 
					            s += ", ";
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,7 +3,7 @@
 | 
				
			|||||||
extern crate html5ever;
 | 
					extern crate html5ever;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use std::{
 | 
					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};
 | 
					use db::{connect, Website};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,7 +5,7 @@ use html5ever::tokenizer::{BufferQueue, TokenizerResult};
 | 
				
			|||||||
use html5ever::tokenizer::{StartTag, TagToken};
 | 
					use html5ever::tokenizer::{StartTag, TagToken};
 | 
				
			||||||
use html5ever::tokenizer::{Token, TokenSink, TokenSinkResult, Tokenizer, TokenizerOpts};
 | 
					use html5ever::tokenizer::{Token, TokenSink, TokenSinkResult, Tokenizer, TokenizerOpts};
 | 
				
			||||||
use html5ever::{local_name, tendril::*};
 | 
					use html5ever::{local_name, tendril::*};
 | 
				
			||||||
use tracing::{debug, error, info, instrument, trace, warn};
 | 
					use tracing::{debug, error, instrument, trace, warn};
 | 
				
			||||||
use url::Url;
 | 
					use url::Url;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use crate::db::Website;
 | 
					use crate::db::Website;
 | 
				
			||||||
@@ -41,7 +41,7 @@ impl TokenSink for Website {
 | 
				
			|||||||
                                            Some(ok)
 | 
					                                            Some(ok)
 | 
				
			||||||
                                        },
 | 
					                                        },
 | 
				
			||||||
                                        Err(e) => {
 | 
					                                        Err(e) => {
 | 
				
			||||||
                                            if attr.value.eq(&Tendril::from_char('#')) {
 | 
					                                            if attr.value.starts_with('#') {
 | 
				
			||||||
                                                trace!("Rejecting # url");
 | 
					                                                trace!("Rejecting # url");
 | 
				
			||||||
                                                None
 | 
					                                                None
 | 
				
			||||||
                                            } else {
 | 
					                                            } else {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user