From 3b3125bb569d3d20e3fa927a85b9b50eaa87cf4b Mon Sep 17 00:00:00 2001 From: shim_ <> Date: Sun, 4 Nov 2018 20:08:20 +0100 Subject: [PATCH] fixed warnings --- src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index c4a2664..a7d89ed 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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, compression: Option, @@ -52,6 +52,7 @@ impl<'a> Snippet<'a> { self.storage.directory.join(&self.id) } + #[allow(dead_code)] fn metadata(&self) -> Result { unimplemented!(); } @@ -112,7 +113,7 @@ fn handle(req: &mut Request) -> IronResult { .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,