From 44ade3988ecf6bbedb93141a83fccfbf38753493 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 1 Dec 2025 11:40:35 +0800 Subject: Update jv.rs --- src/data/ipaddress_history.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/data/ipaddress_history.rs') 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 { - 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 { pub async fn insert_recent_ip_address(ip: impl Into) { 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); -- cgit