about summary refs log tree commit diff
path: root/web/converse/src/handlers.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-04-05T15·22+0200
committertazjin <mail@tazj.in>2021-04-05T19·19+0000
commita0c4b91955662297ec5bd9249a9488ea6d52defc (patch)
treeda1423cb0b9552ed2215628e449928b3dcc159bf /web/converse/src/handlers.rs
parent5387cc9e7d7ef5ca9ecaeea46132510298902769 (diff)
fix(web/converse): Bare minimum changes to build in 2021 r/2443
This project depends on Tokio, via actix, and both of those are bad
ideas. This wasn't as clear 3 years ago as it is now, but to
demonstrate it the project has amassed issues which required at least
this minimum of changes to be buildable in 2021 (using a modern
rustc).

Yes, this adds dozens of new dependencies again (because of a
top-level update) but don't worry: They will be gone when I'm done
here.

Change-Id: I1dde9dc0325da7bdcb6608359fab33e27692dc1d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2857
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'web/converse/src/handlers.rs')
-rw-r--r--web/converse/src/handlers.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/web/converse/src/handlers.rs b/web/converse/src/handlers.rs
index efdffb3f9102..d558afbe1242 100644
--- a/web/converse/src/handlers.rs
+++ b/web/converse/src/handlers.rs
@@ -46,13 +46,13 @@ const NEW_THREAD_LENGTH_ERR: &'static str = "Title and body can not be empty!";
 /// Represents the state carried by the web server actors.
 pub struct AppState {
     /// Address of the database actor
-    pub db: Addr<Syn, DbExecutor>,
+    pub db: Addr<DbExecutor>,
 
     /// Address of the OIDC actor
-    pub oidc: Addr<Syn, OidcExecutor>,
+    pub oidc: Addr<OidcExecutor>,
 
     /// Address of the rendering actor
-    pub renderer: Addr<Syn, Renderer>,
+    pub renderer: Addr<Renderer>,
 }
 
 pub fn forum_index(state: State<AppState>) -> ConverseResponse {
@@ -113,9 +113,9 @@ pub struct NewThreadForm {
 
 /// This handler receives a "New thread"-form and redirects the user
 /// to the new thread after creation.
-pub fn submit_thread(state: State<AppState>,
-                     input: Form<NewThreadForm>,
-                     req: HttpRequest<AppState>) -> ConverseResponse {
+pub fn submit_thread((state, input, req): (State<AppState>,
+                                           Form<NewThreadForm>,
+                                           HttpRequest<AppState>)) -> ConverseResponse {
     // Trim whitespace out of inputs:
     let input = NewThreadForm {
         title: input.title.trim().into(),
@@ -328,7 +328,7 @@ impl EmbeddedFile for App<AppState> {
 pub struct RequireLogin;
 
 impl <S> Middleware<S> for RequireLogin {
-    fn start(&self, req: &mut HttpRequest<S>) -> actix_web::Result<Started> {
+    fn start(&self, req: &HttpRequest<S>) -> actix_web::Result<Started> {
         let logged_in = req.identity().is_some();
         let is_oidc_req = req.path().starts_with("/oidc");