forked from MIrrors/bin
Add more comments
This commit is contained in:
13
src/main.rs
13
src/main.rs
@@ -1,5 +1,4 @@
|
||||
#![feature(proc_macro_hygiene, decl_macro)]
|
||||
#![feature(uniform_paths)]
|
||||
#![feature(type_alias_enum_variants)]
|
||||
|
||||
#[macro_use] extern crate lazy_static;
|
||||
@@ -28,6 +27,10 @@ use rocket::http::ContentType;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
///
|
||||
/// Homepage
|
||||
///
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "index.html")]
|
||||
struct Index {}
|
||||
@@ -38,6 +41,10 @@ fn index() -> Index {
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Submit Paste
|
||||
///
|
||||
|
||||
#[derive(FromForm)]
|
||||
struct IndexForm {
|
||||
val: String
|
||||
@@ -63,6 +70,10 @@ fn submit_raw(input: Data, host: HostHeader) -> std::io::Result<String> {
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Show paste page
|
||||
///
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "paste.html")]
|
||||
struct Render {
|
||||
|
||||
Reference in New Issue
Block a user