From 7b9062aa21affa3d748680a1a681f8f2cf58026c Mon Sep 17 00:00:00 2001 From: Jordan Johnson-Doyle Date: Mon, 11 Feb 2019 10:47:12 +0000 Subject: [PATCH] Clean up code a bit --- src/io.rs | 4 +++- src/main.rs | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/io.rs b/src/io.rs index d4c4562..7e9a77b 100644 --- a/src/io.rs +++ a/src/io.rs @@ -40,6 +40,6 @@ } /// Get a paste by id. Returns `None` if the paste doesn't exist. -pub fn get_paste<'a>(id: &str) -> Option { - ENTRIES.read().unwrap().get(id).map(|f| f.clone()) +pub fn get_paste(id: &str) -> Option { + ENTRIES.read().unwrap().get(id).cloned() }diff --git a/src/main.rs b/src/main.rs index 5ca5a17..cf4c799 100644 --- a/src/main.rs +++ a/src/main.rs @@ -58,8 +58,8 @@ } #[get("/")] -fn render<'a>(key: String) -> Option { - let mut splitter = key.splitn(2, "."); +fn render(key: String) -> Option { + let mut splitter = key.splitn(2, '.'); let key = splitter.next().unwrap(); let ext = splitter.next(); -- rgit 0.1.3