1
- extern crate reqwest;
2
- extern crate serde_json;
3
- #[ macro_use]
4
- extern crate rocket;
5
- extern crate rust_team_data;
6
- extern crate sass_rs;
7
- extern crate siphasher;
8
- extern crate toml;
9
-
10
- #[ macro_use]
11
- extern crate serde;
12
-
13
- extern crate fluent_bundle;
14
- extern crate regex;
15
-
16
1
mod cache;
17
2
mod caching;
18
3
mod category;
@@ -24,9 +9,12 @@ mod teams;
24
9
25
10
use cache:: Cache ;
26
11
use cache:: Cached ;
12
+ use rocket:: catch;
13
+ use rocket:: get;
27
14
use rocket:: tokio:: sync:: RwLock ;
28
15
use rust_version:: RustReleasePost ;
29
16
use rust_version:: RustVersion ;
17
+ use serde:: Serialize ;
30
18
use teams:: encode_zulip_stream;
31
19
use teams:: RustTeams ;
32
20
@@ -76,7 +64,7 @@ static ROBOTS_TXT_DISALLOW_ALL: LazyLock<bool> =
76
64
LazyLock :: new ( || env:: var ( "ROBOTS_TXT_DISALLOW_ALL" ) . is_ok ( ) ) ;
77
65
78
66
#[ derive( Serialize ) ]
79
- struct Context < T : :: serde :: Serialize > {
67
+ struct Context < T : Serialize > {
80
68
page : String ,
81
69
title : String ,
82
70
parent : & ' static str ,
@@ -90,7 +78,7 @@ struct Context<T: ::serde::Serialize> {
90
78
is_translation : bool ,
91
79
}
92
80
93
- impl < T : :: serde :: Serialize > Context < T > {
81
+ impl < T : Serialize > Context < T > {
94
82
fn new ( page : & str , title_id : & str , is_landing : bool , data : T , lang : String ) -> Self {
95
83
let helper = create_loader ( ) ;
96
84
let title = if title_id. is_empty ( ) {
@@ -430,7 +418,7 @@ fn render_subject(category: Category, subject: &str, lang: String) -> Result<Tem
430
418
Ok ( Template :: render ( page, context) )
431
419
}
432
420
433
- #[ launch]
421
+ #[ rocket :: launch]
434
422
async fn rocket ( ) -> _ {
435
423
let templating = Template :: custom ( |engine| {
436
424
engine
@@ -456,7 +444,7 @@ async fn rocket() -> _ {
456
444
. manage ( Arc :: new ( RwLock :: new ( teams) ) )
457
445
. mount (
458
446
"/" ,
459
- routes ! [
447
+ rocket :: routes![
460
448
index,
461
449
category_en,
462
450
governance,
@@ -475,6 +463,6 @@ async fn rocket() -> _ {
475
463
)
476
464
. register (
477
465
"/" ,
478
- catchers ! [ not_found, unprocessable_content, catch_error] ,
466
+ rocket :: catchers![ not_found, unprocessable_content, catch_error] ,
479
467
)
480
468
}
0 commit comments