Remove the useless TransitiveArc from the serve binary

This commit is contained in:
Clément Renault 2020-08-10 14:01:21 +02:00
parent edc06a97d6
commit a4e0f3f724
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -4,7 +4,6 @@ use std::fs::File;
use std::net::SocketAddr; use std::net::SocketAddr;
use std::path::PathBuf; use std::path::PathBuf;
use std::str::FromStr; use std::str::FromStr;
use std::sync::Arc;
use std::time::Instant; use std::time::Instant;
use askama_warp::Template; use askama_warp::Template;
@ -58,21 +57,6 @@ fn highlight_string(string: &str, words: &HashSet<String>) -> String {
output output
} }
// TODO find a better way or move this elsewhere
struct TransitiveArc<T>(Arc<T>);
impl<T: AsRef<[u8]>> AsRef<[u8]> for TransitiveArc<T> {
fn as_ref(&self) -> &[u8] {
self.0.as_ref().as_ref()
}
}
impl<T> Clone for TransitiveArc<T> {
fn clone(&self) -> TransitiveArc<T> {
TransitiveArc(self.0.clone())
}
}
#[derive(Template)] #[derive(Template)]
#[template(path = "index.html")] #[template(path = "index.html")]
struct IndexTemplate { struct IndexTemplate {