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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user