diff options
| author | Fuwn <[email protected]> | 2021-02-20 22:57:33 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-02-20 22:57:33 +0000 |
| commit | 0a8126ac5330fc022b6d1b5fb4b9c2fa38028ef7 (patch) | |
| tree | c4f1201aeea4fbac52fa033cda8c3f72beb062fa /src/api.rs | |
| parent | chore: update log (diff) | |
| download | chan-0a8126ac5330fc022b6d1b5fb4b9c2fa38028ef7.tar.xz chan-0a8126ac5330fc022b6d1b5fb4b9c2fa38028ef7.zip | |
chore: formatting
Diffstat (limited to 'src/api.rs')
| -rw-r--r-- | src/api.rs | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -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 |