author | Jordan Johnson-Doyle <jordan@doyle.la> | 2019-02-11 10:47:12.0 +00:00:00 |
---|---|---|
committer | Jordan Johnson-Doyle <jordan@doyle.la> | 2019-02-11 10:47:12.0 +00:00:00 |
commit | 7b9062aa21affa3d748680a1a681f8f2cf58026c [patch] |
|
tree | 73d444e0a5d2b060f3f9e8f370fad18aed0200c1 |
|
parent | 9d4b3ecafc4e7c6fea1ac543b3a67f81b009e37d |
|
download | 7b9062aa21affa3d748680a1a681f8f2cf58026c.tar.gz |
Clean up code a bit
Diff
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<String> { ENTRIES.read().unwrap().get(id).map(|f| f.clone()) pub fn get_paste(id: &str) -> Option<String> { 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("/<key>")] fn render<'a>(key: String) -> Option<Render> { let mut splitter = key.splitn(2, "."); fn render(key: String) -> Option<Render> { let mut splitter = key.splitn(2, '.'); let key = splitter.next().unwrap(); let ext = splitter.next();