moderatior
fix name changes
bendn 2024-04-07
parent ae4479f · commit c0bc838
-rw-r--r--src/main.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index 652775d..5162e87 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -38,12 +38,10 @@ pub fn format(log: AuditLogEntry) -> Option<String> {
.into_iter()
.map(|x| {
Some(match x {
- Nick { old, new } => {
- format!("nick ~~{}~~ {RIGHT} {}", old.as_ref()?, new.as_ref()?)
- }
- Name { old, new } => {
- format!("name ~~{}~~ {RIGHT} {}", old.as_ref()?, new.as_ref()?)
- }
+ Nick { old: Some(old), new: Some(new) } => format!("nick ~~{old}~~ {RIGHT} {new}"),
+ Nick { new: Some(new),.. } => format!("nick {ADD} {new}"),
+ Name { old: Some(old), new: Some(new) } => format!("name ~~{old}~~ {RIGHT} {new}"),
+ Name { new: Some(new), .. } => format!("name {ADD} {new}"),
RolesRemove { new, .. } => new
.as_ref()?
.into_iter()