fix: totally fix rustc version check

C-style shit syntax
This commit is contained in:
mokurin000
2025-07-31 20:02:46 +08:00
parent 6cb1dcefe8
commit 789d46991d
4 changed files with 22 additions and 14 deletions

View File

@@ -201,6 +201,17 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
use crate::cache::{open_table_read, read_txn};
let file = OpenOptions::new()
.create(true)
.truncate(true)
.write(true)
.open("players.json")?;
#[cfg(file_lock_ready)]
file.try_lock()?;
let writer = BufWriter::new(file);
let txn = read_txn()?;
let table = open_table_read(&txn)?;
@@ -215,18 +226,6 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
.map(|(value, _)| value)
.collect::<Vec<GetUserPreviewApiResp>>();
let file = OpenOptions::new()
.create(true)
.truncate(true)
.write(true)
.open("players.json")?;
#[rustversion::since(1.89)]
{
file.lock()?;
}
let writer = BufWriter::new(file);
serde_json::to_writer(writer, &user_ids)?;
info!("dumped {} user id", user_ids.len());
}