fixed warnings

This commit is contained in:
shim_ 2018-11-04 20:08:20 +01:00
parent 145f7cfd40
commit 3b3125bb56

View File

@ -5,9 +5,8 @@ extern crate snap;
use chrono::*;
use iron::method::Method;
use iron::modifiers::Redirect;
use iron::prelude::*;
use iron::Url;
use iron::url::Url;
use rand::Rng;
use std::fs;
use std::fs::File;
@ -21,6 +20,7 @@ struct Snippet<'a> {
storage: &'a SnippetStorage<'a>,
}
#[allow(dead_code)]
struct SnippetMeta {
created: DateTime<UTC>,
compression: Option<String>,
@ -52,6 +52,7 @@ impl<'a> Snippet<'a> {
self.storage.directory.join(&self.id)
}
#[allow(dead_code)]
fn metadata(&self) -> Result<SnippetMeta, io::Error> {
unimplemented!();
}
@ -112,7 +113,7 @@ fn handle(req: &mut Request) -> IronResult<Response> {
.map_err(|err| IronError::new(err, "Failed to save snippet"))
};
snip.map(|snip| {
let mut snip_url = req.url.clone().into_generic_url();
let mut snip_url: Url = req.url.clone().into();
snip_url.set_path(&*("/".to_string() + &*snip.id));
/*Response::with((
iron::status::TemporaryRedirect,