add some formatting shit

This commit is contained in:
Reid 2023-08-29 01:10:33 -07:00
parent 4358ec6483
commit 80c884f489
Signed by: reidlab
GPG key ID: 6C9EAA3364F962C8
4 changed files with 25 additions and 0 deletions

View file

@ -1,3 +1,4 @@
pub mod accounts;
pub mod clean;
pub mod format;
pub mod gjp2;

16
src/helpers/format.rs Normal file
View file

@ -0,0 +1,16 @@
use std::collections::HashMap;
pub fn format(map: HashMap<i32, impl ToString>) -> String {
let mut result = String::new();
for (k, v) in map {
result.push_str(&format!("{}:{}", k, v.to_string()));
result.push(':');
}
if !result.is_empty() {
result.pop();
}
return result;
}