diff options
| author | mtul0729 <52401682+mtul0729@users.noreply.github.com> | 2025-03-26 08:34:00 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-26 08:34:00 +0800 |
| commit | dd8f3e4528d45b7602df7ea6380b92a87dc4f711 (patch) | |
| tree | faf8368ed6e06a78547959414710848ff19a06ff /src/config/session.rs | |
| parent | a71e7c6be72965afd537aae076e0aee9e6f0755e (diff) | |
| download | aichat-dd8f3e4528d45b7602df7ea6380b92a87dc4f711.tar.gz | |
refactor: replace `lazy_static` with `std::sync::LazyLock` (#1246)
Diffstat (limited to 'src/config/session.rs')
| -rw-r--r-- | src/config/session.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/config/session.rs b/src/config/session.rs index 2bc1b6c..a895e64 100644 --- a/src/config/session.rs +++ b/src/config/session.rs @@ -12,10 +12,9 @@ use serde_json::json; use std::collections::HashMap; use std::fs::{read_to_string, write}; use std::path::Path; +use std::sync::LazyLock; -lazy_static::lazy_static! { - static ref RE_AUTONAME_PREFIX: Regex = Regex::new(r"\d{8}T\d{6}-").unwrap(); -} +static RE_AUTONAME_PREFIX: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"\d{8}T\d{6}-").unwrap()); #[derive(Debug, Clone, Default, Deserialize, Serialize)] pub struct Session { |
