Upgrade rocket to latest version
This commit is contained in:
parent
439f4bf2b4
commit
ebe0df5cc6
4 changed files with 461 additions and 612 deletions
1057
Cargo.lock
generated
1057
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -17,7 +17,7 @@ rand = { version = "0.7", features = ["nightly"] }
|
||||||
gpw = "0.1"
|
gpw = "0.1"
|
||||||
syntect = "4.1"
|
syntect = "4.1"
|
||||||
serde_derive = "1.0"
|
serde_derive = "1.0"
|
||||||
tokio = { version = "0.2", features = ["sync"] }
|
tokio = { version = "0.2", features = ["sync", "macros"] }
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
|
|
|
@ -12,7 +12,6 @@ use owning_ref::OwningRef;
|
||||||
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::sync::{PoisonError};
|
|
||||||
|
|
||||||
use tokio::sync::{RwLock, RwLockReadGuard};
|
use tokio::sync::{RwLock, RwLockReadGuard};
|
||||||
|
|
||||||
|
|
13
src/main.rs
13
src/main.rs
|
@ -25,7 +25,6 @@ use rocket::response::Redirect;
|
||||||
use rocket::Data;
|
use rocket::Data;
|
||||||
|
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::io::Read;
|
|
||||||
|
|
||||||
use tokio::io::AsyncReadExt;
|
use tokio::io::AsyncReadExt;
|
||||||
|
|
||||||
|
@ -125,8 +124,14 @@ async fn show_paste(key: String, plaintext: IsPlaintextRequest) -> Result<Conten
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
#[tokio::main]
|
||||||
rocket::ignite()
|
async fn main() {
|
||||||
|
let result = rocket::ignite()
|
||||||
.mount("/", routes![index, submit, submit_raw, show_paste])
|
.mount("/", routes![index, submit, submit_raw, show_paste])
|
||||||
.launch();
|
.launch()
|
||||||
|
.await;
|
||||||
|
|
||||||
|
if let Err(e) = result {
|
||||||
|
eprintln!("Failed to launch Rocket: {:#?}", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue