Watch
0
0
Fork
You've already forked hyperhive
0

swarm-controller: the forge webhook takes two narrow sub-states

This commit is contained in:
atlas 2026-11-30 03:46:25 +01:00
commit 98341e24a6

View file

@ -930,7 +930,16 @@ pub(crate) async fn read_declarations<'a>(
state: &AppState,
hives: impl Iterator<Item = &'a HiveEntry>,
) -> Result<Vec<(String, swarm_wire::wanted::HiveWanted)>, (String, anyhow::Error)> {
let Some(writer) = state.wanted.as_deref() else {
read_declarations_of(state.wanted.as_deref(), hives).await
}
/// [`read_declarations`] over the wanted-state writer alone, for a caller that
/// holds only that.
pub(crate) async fn read_declarations_of<'a>(
writer: Option<&wanted::WantedWriter>,
hives: impl Iterator<Item = &'a HiveEntry>,
) -> Result<Vec<(String, swarm_wire::wanted::HiveWanted)>, (String, anyhow::Error)> {
let Some(writer) = writer else {
return Ok(Vec::new());
};
let mut declared = Vec::new();