From 850b14c47c89c3f95ee4bce607d9d42dac29079a Mon Sep 17 00:00:00 2001 From: owen Date: Wed, 30 Jul 2025 10:31:10 +0800 Subject: [PATCH 1/2] remove unuse import --- src/main.rs | 2 +- src/session/session_manage.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6fe0ad6..7aa9e1f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ use std::sync::{Arc, RwLock}; use axum::body::Body; use axum::extract::Multipart; -use axum::http::{Request, Response}; +use axum::http::Response; use axum::response::Html; use axum::response::IntoResponse; use axum::Form; diff --git a/src/session/session_manage.rs b/src/session/session_manage.rs index 16c0fdf..65e2e8e 100644 --- a/src/session/session_manage.rs +++ b/src/session/session_manage.rs @@ -3,8 +3,6 @@ use std::sync::Arc; use std::sync::OnceLock; use std::sync::RwLock; -use tklog::error; - use crate::session::session::Session; #[derive(Clone, Debug)] @@ -23,7 +21,7 @@ impl SessionManager { let timeout = timeout.unwrap_or(DEFAULT_TIMEOUT); let manager = SessionManager { timeout, - sessions: Arc::new(RwLock::new(HashMap::new())), + sessions: Arc::new(RwLock::new(HashMap::with_capacity(DEFAULT_SESSION_COUNT))), }; SESSION_MANAGER -- Gitee From 691b9fa12585c4a7d201bb36ff8fd7d5bd3724a6 Mon Sep 17 00:00:00 2001 From: owen Date: Wed, 30 Jul 2025 12:33:02 +0800 Subject: [PATCH 2/2] blog list UI performance --- templates/html/blog_list.html | 273 ++++++++++++++++------------------ 1 file changed, 127 insertions(+), 146 deletions(-) diff --git a/templates/html/blog_list.html b/templates/html/blog_list.html index 29fa718..970bec6 100644 --- a/templates/html/blog_list.html +++ b/templates/html/blog_list.html @@ -5,104 +5,65 @@ RustU - - - + + + + -
+
-
- {% for article in vec1 %} - - {% endfor %} -
- -
- {% for article in vec2 %} - - {% endfor %} -
- -
- {% for article in vec3 %} -
+ {% for column in [vec1, vec2, vec3] %} +
+ {% for article in column %} + + {% endfor %}
-
- -
-
-
-
- + +
+
+
+ +
-
-
+ +

粤公网安备44011802000978号 ICP备案: 粤ICP备2024315825号-1 © 2024 你我同锈. All rights reserved.

- -- Gitee