From 2bbab69e94e25ee2b027f3f116553dd9228e6812 Mon Sep 17 00:00:00 2001 From: jordan@doyle.la Date: Thu, 23 Jul 2020 15:28:55 +0100 Subject: [PATCH] cargo fmt --- src/io.rs | 9 ++++++--- src/main.rs | 9 ++++++++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/io.rs b/src/io.rs index 156c3e0..588acbf 100644 --- a/src/io.rs +++ a/src/io.rs @@ -60,16 +60,15 @@ pub async fn store_paste(id: String, content: String) { purge_old().await; - ENTRIES - .write() - .await - .insert(id, content); + ENTRIES.write().await.insert(id, content); } /// Get a paste by id. /// /// Returns `None` if the paste doesn't exist. -pub async fn get_paste(id: &str) -> Option, String>> { +pub async fn get_paste( + id: &str, +) -> Option, String>> { // need to box the guard until owning_ref understands Pin is a stable address let or = RwLockReadGuardRef::new(Box::new(ENTRIES.read().await)); diff --git a/src/main.rs b/src/main.rs index c36cca6..4522fd0 100644 --- a/src/main.rs +++ a/src/main.rs @@ -64,8 +64,11 @@ #[put("/", data = "")] async fn submit_raw(input: Data, host: HostHeader<'_>) -> Result { let mut data = String::new(); - input.open().take(1024 * 1000) - .read_to_string(&mut data).await + input + .open() + .take(1024 * 1000) + .read_to_string(&mut data) + .await .map_err(|_| Status::InternalServerError)?; let id = generate_id(); @@ -108,7 +111,7 @@ None => String::from(RawStr::from_str(entry).html_escape()), }; - // Add tags to enable line numbering with CSS + // Add tags to enable line numbering with CSS let html = format!( "{}", code_highlighted.replace("\n", "\n") -- rgit 0.1.3