memoryd, proto, brokerd, bxctl: repeated error lines written once

Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
This commit is contained in:
2026-09-25 16:41:44 -07:00
parent b98f373ead
commit 3640d32de0
5 changed files with 54 additions and 82 deletions
+5 -8
View File
@@ -25,16 +25,13 @@ pub fn grants() -> Result<Vec<LoadedGrant>, GrantProblem> {
let sources: &[(&str, &str)] = &[("builtin-memory", MEMORY), ("builtin-recall", RECALL)];
let mut out: Vec<LoadedGrant> = Vec::new();
for (id, text) in sources {
let grant = toml::from_str::<Grant>(text).map_err(|error| GrantProblem {
let problem = |error: String| GrantProblem {
file: id.to_string(),
line: None,
problem: error.to_string(),
})?;
let sha256 = sha256(text.as_bytes()).map_err(|error| GrantProblem {
file: id.to_string(),
line: None,
problem: error.to_string(),
})?;
problem: error,
};
let grant = toml::from_str::<Grant>(text).map_err(|e| problem(e.to_string()))?;
let sha256 = sha256(text.as_bytes()).map_err(|e| problem(e.to_string()))?;
out.push(LoadedGrant {
id: id.to_string(),
grant,