From a7bc93031ae4a951203aea9fb2ecf288af4aa1c0 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 8 Apr 2021 17:21:31 +0200 Subject: [PATCH] Remove useless import --- src/utils/webpage_utils.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/utils/webpage_utils.rs b/src/utils/webpage_utils.rs index 95704fa..9dd742d 100644 --- a/src/utils/webpage_utils.rs +++ b/src/utils/webpage_utils.rs @@ -6,7 +6,7 @@ use std::time::Duration; use webpage::{Webpage, WebpageOptions}; -use crate::data::error::{ExecError, Res}; +use crate::data::error::Res; use crate::data::post::PostWebLink; /// Attempt to get information about a URL given by a user @@ -19,10 +19,6 @@ pub fn get_post_web_link(url: &str) -> Res { let page = Webpage::from_url(url, options)?; - /*if !page.http.content_type.to_lowercase().starts_with("text/html") { - return Err(ExecError::boxed_string(format!("The page at {} as an invalid content type: {}!", url, page.http.content_type))); - }*/ - Ok(PostWebLink { url: url.to_string(), title: page.html.opengraph.properties.get("title").map(String::to_string),