rename GEMINI_MIME to GEMINI_MIME_STR

This commit is contained in:
panicbit 2020-11-14 00:27:41 +01:00
parent 4b08edc890
commit b97c7a6f12
2 changed files with 4 additions and 4 deletions

View File

@ -201,10 +201,10 @@ fn load_key() -> Result<PrivateKey> {
Ok(key)
}
const GEMINI_MIME: &str = "text/gemini";
const GEMINI_MIME_STR: &str = "text/gemini";
pub fn gemini_mime() -> Result<Mime> {
let mime = GEMINI_MIME.parse()?;
let mime = GEMINI_MIME_STR.parse()?;
Ok(mime)
}

View File

@ -6,7 +6,7 @@ use tokio::{
fs::{self, File},
io,
};
use crate::{GEMINI_MIME, Response, gemini_mime};
use crate::{GEMINI_MIME_STR, Response, gemini_mime};
use itertools::Itertools;
pub async fn serve_file<P: AsRef<Path>>(path: P, mime: &Mime) -> Result<Response> {
@ -90,7 +90,7 @@ pub fn guess_mime_from_path<P: AsRef<Path>>(path: P) -> Mime {
let extension = path.extension().and_then(|s| s.to_str());
let mime = match extension {
Some(extension) => match extension {
"gemini" => GEMINI_MIME,
"gemini" => GEMINI_MIME_STR,
"txt" => "text/plain",
"jpeg" | "jpg" | "jpe" => "image/jpeg",
"png" => "image/png",