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