mirror of
https://tangled.org/tranquil.farm/tranquil-pds
synced 2026-09-20 01:04:14 +00:00
oauth error msg improvement, general code quality
This commit is contained in:
@@ -182,11 +182,10 @@ static STRINGS_FI: NotificationStrings = NotificationStrings {
|
||||
};
|
||||
|
||||
pub fn format_message(template: &str, vars: &[(&str, &str)]) -> String {
|
||||
let mut result = template.to_string();
|
||||
for (key, value) in vars {
|
||||
result = result.replace(&format!("{{{}}}", key), value);
|
||||
}
|
||||
result
|
||||
vars.iter()
|
||||
.fold(template.to_string(), |result, (key, value)| {
|
||||
result.replace(&format!("{{{}}}", key), value)
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user