diff options
| author | 魏曹先生 <1992414357@qq.com> | 2025-12-01 11:40:35 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2025-12-01 11:42:39 +0800 |
| commit | 44ade3988ecf6bbedb93141a83fccfbf38753493 (patch) | |
| tree | 9a7db642825e4d63bfbeef8770d043c30c2bc6be /src/data/ipaddress_history.rs | |
| parent | 8ad597222a3f768b5ba3e260dd896ea64a0bf70a (diff) | |
Update jv.rs
Diffstat (limited to 'src/data/ipaddress_history.rs')
| -rw-r--r-- | src/data/ipaddress_history.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/data/ipaddress_history.rs b/src/data/ipaddress_history.rs index 3d2bb5b..2787c36 100644 --- a/src/data/ipaddress_history.rs +++ b/src/data/ipaddress_history.rs @@ -1,4 +1,4 @@ -use just_enough_vcs::vcs::current::current_doc_dir; +use just_enough_vcs::vcs::current::current_cfg_dir; const IP_HISTORY_NAME: &str = "ip_history.txt"; @@ -7,7 +7,7 @@ pub struct IpAddressHistory { } pub async fn get_recent_ip_address() -> Vec<String> { - if let Some(local) = current_doc_dir() { + if let Some(local) = current_cfg_dir() { let path = local.join(IP_HISTORY_NAME); match tokio::fs::read_to_string(path).await { Ok(content) => content.lines().map(String::from).collect(), @@ -20,7 +20,7 @@ pub async fn get_recent_ip_address() -> Vec<String> { pub async fn insert_recent_ip_address(ip: impl Into<String>) { let ip = ip.into(); - if let Some(local) = current_doc_dir() { + if let Some(local) = current_cfg_dir() { let path = local.join(IP_HISTORY_NAME); let mut recent_ips = get_recent_ip_address().await; recent_ips.retain(|existing_ip| existing_ip != &ip); |
