Open grievances: name a subject once

This commit is contained in:
Meta Vens 2026-12-03 04:40:12 +01:00
commit 9e6fcd6bc5
2 changed files with 2 additions and 5 deletions

View file

@ -578,7 +578,7 @@ fn a_deed_the_room_saw_is_an_open_grievance_until_something_answers_it() {
strike(&mut kernel, &clockwork, -30);
let block = open_grievances(&kernel);
assert_eq!(block.matches("wronged").count(), 1, "one doer, no other: {block}");
assert_eq!(block.matches("; acts seen by:").count(), 1, "one doer, no other: {block}");
assert!(block.contains("The Yard Farmer"), "{block}");
assert!(segment(&block, "wronged", ";").contains("The Yard Reeve"), "{block}");
let seen = segment(&block, "acts seen by:", "forums covering");

View file

@ -994,10 +994,7 @@ fn render_open_grievances(snapshot: &WorldSnapshot) -> String {
use crate::attitude::AttitudeCause;
use crate::patch::KnowledgeSource;
let name = |id: SubjectId| {
label_for_any_id(snapshot, &id_text(id)).map_or_else(
|| format!("[{}]", id_text(id)),
|label| format!("{label} [{}]", id_text(id)),
)
label_for_any_id(snapshot, &id_text(id)).unwrap_or_else(|| format!("[{}]", id_text(id)))
};
let mut out = String::from("\n Open grievances (derived: who was wronged, who saw it, what answers it):");
let mut any = false;