aboutsummaryrefslogtreecommitdiff
path: root/server/locale-export/src/main.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-10-11 00:24:11 +0200
committermetamuffin <metamuffin@disroot.org>2025-10-11 00:24:11 +0200
commite68a9eb5e9e15372313f9017be4a2d58fb690bfc (patch)
tree690287a2c71d87c2955e992f1e9575166237188a /server/locale-export/src/main.rs
parent3fe8ba7f1b9fa7e38fa03f55fd898c8ca2a0e996 (diff)
downloadhurrycurry-e68a9eb5e9e15372313f9017be4a2d58fb690bfc.tar
hurrycurry-e68a9eb5e9e15372313f9017be4a2d58fb690bfc.tar.bz2
hurrycurry-e68a9eb5e9e15372313f9017be4a2d58fb690bfc.tar.zst
clippy + fmt; start using if let chains
Diffstat (limited to 'server/locale-export/src/main.rs')
-rw-r--r--server/locale-export/src/main.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/server/locale-export/src/main.rs b/server/locale-export/src/main.rs
index 23823716..50cfe9eb 100644
--- a/server/locale-export/src/main.rs
+++ b/server/locale-export/src/main.rs
@@ -1,9 +1,9 @@
-use anyhow::{anyhow, Context, Result};
+use anyhow::{Context, Result, anyhow};
use clap::Parser;
use std::{
collections::BTreeMap,
fmt::Write as W2,
- fs::{read_to_string, File},
+ fs::{File, read_to_string},
io::Write,
path::{Path, PathBuf},
};
@@ -105,10 +105,10 @@ msgstr ""
.to_string_lossy(),
ini.into_iter()
.try_fold(String::new(), |mut a, (mut key, value)| {
- if let Some(id_map) = &id_map {
- if let Some(new_id) = id_map.get(&key) {
- key = new_id.to_owned()
- }
+ if let Some(id_map) = &id_map
+ && let Some(new_id) = id_map.get(&key)
+ {
+ key = new_id.to_owned()
}
let key = serde_json::to_string(&key)?;
let value = serde_json::to_string(&value)?;