upgrading to actix-v4-beta

This commit is contained in:
realaravinth
2021-06-30 20:13:12 +05:30
parent 9ed458ebfa
commit 9f940c317a
24 changed files with 728 additions and 1192 deletions

View File

@@ -226,7 +226,6 @@ async fn signout(id: Identity) -> impl Responder {
id.forget();
}
HttpResponse::Found()
.header(header::LOCATION, "/login")
.append_header((header::LOCATION, "/login"))
.finish()
.into_body()
}

View File

@@ -24,11 +24,11 @@ use crate::errors::*;
use crate::AppData;
pub struct Notification {
pub name: String,
pub heading: String,
pub message: String,
pub received: OffsetDateTime,
pub id: i32,
pub name: Option<String>,
pub heading: Option<String>,
pub message: Option<String>,
pub received: Option<OffsetDateTime>,
pub id: Option<i32>,
}
#[derive(Deserialize, Serialize)]
@@ -43,11 +43,11 @@ pub struct NotificationResp {
impl From<Notification> for NotificationResp {
fn from(n: Notification) -> Self {
NotificationResp {
name: n.name,
heading: n.heading,
received: n.received.unix_timestamp(),
id: n.id,
message: n.message,
name: n.name.unwrap(),
heading: n.heading.unwrap(),
received: n.received.unwrap().unix_timestamp(),
id: n.id.unwrap(),
message: n.message.unwrap(),
}
}
}

View File

@@ -161,7 +161,7 @@ mod tests {
#[test]
fn feature() {
actix_rt::System::new("trest")
actix_rt::System::new()
.block_on(async move { get_pow_config_works().await });
}