diff options
Diffstat (limited to 'server')
| -rw-r--r-- | server/Cargo.toml | 16 | ||||
| -rw-r--r-- | server/src/helper/filter_sort.rs | 10 | ||||
| -rw-r--r-- | server/src/ui/admin/log.rs | 2 | ||||
| -rw-r--r-- | server/src/ui/admin/user.rs | 6 | ||||
| -rw-r--r-- | server/src/ui/error.rs | 2 | ||||
| -rw-r--r-- | server/src/ui/node.rs | 2 | ||||
| -rw-r--r-- | server/src/ui/search.rs | 2 |
7 files changed, 20 insertions, 20 deletions
diff --git a/server/Cargo.toml b/server/Cargo.toml index 0bc1960..a3de6a2 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -15,23 +15,23 @@ jellylogic = { path = "../logic" } anyhow = { workspace = true } async-recursion = "1.1.1" base64 = "0.22.1" -bincode = { version = "2.0.0-rc.3", features = ["serde", "derive"] } +bincode = { version = "2.0.1", features = ["serde", "derive"] } chashmap = "2.2.2" -chrono = { version = "0.4.39", features = ["serde"] } -env_logger = "0.11.6" +chrono = { version = "0.4.42", features = ["serde"] } +env_logger = "0.11.8" futures = "0.3.31" log = { workspace = true } -rand = "0.9.0" +rand = "0.9.2" rocket = { workspace = true, features = ["secrets", "json"] } rocket_ws = { workspace = true } -serde = { version = "1.0.217", features = ["derive", "rc"] } -serde_json = "1.0.138" +serde = { version = "1.0.228", features = ["derive", "rc"] } +serde_json = "1.0.145" serde_yml = "0.0.12" tokio = { workspace = true } -tokio-util = { version = "0.7.13", features = ["io", "io-util"] } +tokio-util = { version = "0.7.17", features = ["io", "io-util"] } [build-dependencies] -glob = "0.3.2" +glob = "0.3.3" [features] bypass-auth = [] diff --git a/server/src/helper/filter_sort.rs b/server/src/helper/filter_sort.rs index 10d397a..fa96662 100644 --- a/server/src/helper/filter_sort.rs +++ b/server/src/helper/filter_sort.rs @@ -15,10 +15,10 @@ use rocket::{ UriDisplayQuery, }; -impl Into<NodeFilterSort> for ANodeFilterSort { - fn into(self) -> NodeFilterSort { +impl From<ANodeFilterSort> for NodeFilterSort { + fn from(val: ANodeFilterSort) -> Self { NodeFilterSort { - sort_by: self.sort_by.map(|e| match e { + sort_by: val.sort_by.map(|e| match e { ASortProperty::ReleaseDate => SortProperty::ReleaseDate, ASortProperty::Title => SortProperty::Title, ASortProperty::Index => SortProperty::Index, @@ -33,7 +33,7 @@ impl Into<NodeFilterSort> for ANodeFilterSort { ASortProperty::RatingUser => SortProperty::RatingUser, ASortProperty::RatingLikesDivViews => SortProperty::RatingLikesDivViews, }), - filter_kind: self.filter_kind.map(|l| { + filter_kind: val.filter_kind.map(|l| { l.into_iter() .map(|e| match e { AFilterProperty::FederationLocal => FilterProperty::FederationLocal, @@ -54,7 +54,7 @@ impl Into<NodeFilterSort> for ANodeFilterSort { }) .collect() }), - sort_order: self.sort_order.map(|e| match e { + sort_order: val.sort_order.map(|e| match e { ASortOrder::Ascending => SortOrder::Ascending, ASortOrder::Descending => SortOrder::Descending, }), diff --git a/server/src/ui/admin/log.rs b/server/src/ui/admin/log.rs index 61d2ba7..24671bb 100644 --- a/server/src/ui/admin/log.rs +++ b/server/src/ui/admin/log.rs @@ -20,7 +20,7 @@ use rocket_ws::{Message, Stream, WebSocket}; use serde_json::json; #[get("/admin/log?<warnonly>", rank = 2)] -pub fn r_admin_log<'a>(ri: RequestInfo, warnonly: bool) -> MyResult<RawHtml<String>> { +pub fn r_admin_log(ri: RequestInfo, warnonly: bool) -> MyResult<RawHtml<String>> { ri.session.assert_admin()?; let messages = get_log_buffer(warnonly) .into_iter() diff --git a/server/src/ui/admin/user.rs b/server/src/ui/admin/user.rs index fa84f52..dd68383 100644 --- a/server/src/ui/admin/user.rs +++ b/server/src/ui/admin/user.rs @@ -37,7 +37,7 @@ pub fn r_admin_users(ri: RequestInfo) -> MyResult<RawHtml<String>> { } #[get("/admin/user/<name>")] -pub fn r_admin_user<'a>(ri: RequestInfo, name: &'a str) -> MyResult<RawHtml<String>> { +pub fn r_admin_user(ri: RequestInfo, name: &str) -> MyResult<RawHtml<String>> { ri.session.assert_admin()?; let user = get_user(&ri.session, name)?; @@ -89,7 +89,7 @@ pub fn r_admin_user_permission( Redirect::to(u_admin_user(name)), tr( ri.lang, - &"admin.users.permission_update_success".to_string(), + "admin.users.permission_update_success", ), )) } @@ -100,6 +100,6 @@ pub fn r_admin_remove_user(ri: RequestInfo, name: &str) -> MyResult<Flash<Redire delete_user(&ri.session, name)?; Ok(Flash::success( Redirect::to(u_admin_users()), - tr(ri.lang, &"admin.users.remove_success".to_string()), + tr(ri.lang, "admin.users.remove_success"), )) } diff --git a/server/src/ui/error.rs b/server/src/ui/error.rs index f1c9d3a..9e9f7e5 100644 --- a/server/src/ui/error.rs +++ b/server/src/ui/error.rs @@ -25,7 +25,7 @@ static ERROR_IMAGE: LazyLock<Vec<u8>> = LazyLock::new(|| { }); #[catch(default)] -pub fn r_catch<'a>(status: Status, _request: &Request) -> RawHtml<String> { +pub fn r_catch(status: Status, _request: &Request) -> RawHtml<String> { catch_with_message(format!("{status}")) } fn catch_with_message(message: String) -> RawHtml<String> { diff --git a/server/src/ui/node.rs b/server/src/ui/node.rs index 5004b7b..a6c0cc2 100644 --- a/server/src/ui/node.rs +++ b/server/src/ui/node.rs @@ -14,7 +14,7 @@ use jellyui::{node_page::NodePage, render_page}; use rocket::{get, response::content::RawHtml, serde::json::Json, Either}; #[get("/n/<id>?<parents>&<children>&<filter..>")] -pub async fn r_node<'a>( +pub async fn r_node( ri: RequestInfo, id: A<NodeID>, filter: Option<ANodeFilterSort>, diff --git a/server/src/ui/search.rs b/server/src/ui/search.rs index 1812130..567f000 100644 --- a/server/src/ui/search.rs +++ b/server/src/ui/search.rs @@ -12,7 +12,7 @@ use jellyui::{render_page, search::SearchPage}; use rocket::{get, response::content::RawHtml, serde::json::Json, Either}; #[get("/search?<query>&<page>")] -pub async fn r_search<'a>( +pub async fn r_search( ri: RequestInfo, query: Option<&str>, page: Option<usize>, |