aboutsummaryrefslogtreecommitdiff
path: root/src/api.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-02-20 22:57:33 +0000
committerFuwn <[email protected]>2021-02-20 22:57:33 +0000
commit0a8126ac5330fc022b6d1b5fb4b9c2fa38028ef7 (patch)
treec4f1201aeea4fbac52fa033cda8c3f72beb062fa /src/api.rs
parentchore: update log (diff)
downloadchan-0a8126ac5330fc022b6d1b5fb4b9c2fa38028ef7.tar.xz
chan-0a8126ac5330fc022b6d1b5fb4b9c2fa38028ef7.zip
chore: formatting
Diffstat (limited to 'src/api.rs')
-rw-r--r--src/api.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/api.rs b/src/api.rs
index 8fd61c5..3947452 100644
--- a/src/api.rs
+++ b/src/api.rs
@@ -4,19 +4,19 @@ use rocket::response::Redirect;
use crate::db::*;
use crate::structures::*;
-// POST: Create a new thread.
+/// POST: Create a new thread.
#[post("/post", data = "<thread>")]
pub fn post(thread: Form<Thread>) -> Redirect {
- // Pretty rudimentary error handling.
- match new_thread(Thread {
- board: thread.board.clone(),
- name: thread.name.clone(),
- comment: thread.comment.clone(),
- }) {
- Ok(()) => { },
- Err(why) => println!("Error creating new thread: {}", why)
- }
+ // Pretty rudimentary error handling.
+ match new_thread(Thread {
+ board: thread.board.clone(),
+ name: thread.name.clone(),
+ comment: thread.comment.clone(),
+ }) {
+ Ok(()) => { },
+ Err(why) => println!("Error creating new thread: {}", why)
+ }
- // Redirect to all posts.
- Redirect::to(format!("/board/{}", thread.board))
-}
+ // Redirect to all posts.
+ Redirect::to(format!("/board/{}", thread.board))
+} \ No newline at end of file