Remove "Item updated" message from every single item diff

This commit is contained in:
SkyfallWasTaken 2024-07-01 18:27:59 +01:00
parent 88107872e9
commit fbf7134ff6

View file

@ -7,7 +7,6 @@ pub fn diff_items(old: ShopItem, new: ShopItem) -> Option<String> {
} }
let mut result = Vec::new(); let mut result = Vec::new();
result.push("*Item updated*".into());
if old.full_name != new.full_name { if old.full_name != new.full_name {
result.push(format!("*Name:* {}{}", old.full_name, new.full_name)); result.push(format!("*Name:* {}{}", old.full_name, new.full_name));
@ -65,7 +64,6 @@ mod test {
diff_items(old, new), diff_items(old, new),
Some( Some(
indoc! {" indoc! {"
*Item updated*
*Name:* Test *Name:* Test
*Price:* 1 2"} *Price:* 1 2"}
.into() .into()
@ -91,7 +89,6 @@ mod test {
diff_items(old, new), diff_items(old, new),
Some( Some(
indoc! {" indoc! {"
*Item updated*
*Name:* Test *Name:* Test
*Description:* Lorem ipsum Dolor sit amet"} *Description:* Lorem ipsum Dolor sit amet"}
.into() .into()
@ -117,7 +114,6 @@ mod test {
diff_items(old, new), diff_items(old, new),
Some( Some(
indoc! {" indoc! {"
*Item updated*
*Name:* Test *Name:* Test
*Stock:* 10 9"} *Stock:* 10 9"}
.into() .into()
@ -143,7 +139,6 @@ mod test {
diff_items(old, new), diff_items(old, new),
Some( Some(
indoc! {" indoc! {"
*Item updated*
*Name:* Test *Name:* Test
*Stock:* 10 Unlimited"} *Stock:* 10 Unlimited"}
.into() .into()
@ -169,7 +164,6 @@ mod test {
diff_items(old, new), diff_items(old, new),
Some( Some(
indoc! {" indoc! {"
*Item updated*
*Name:* Test *Name:* Test
*Stock:* Unlimited 10"} *Stock:* Unlimited 10"}
.into() .into()