radicle: note about Announcer::can_continue

Making a note of that `Announcer::can_continue` might never be able to hit the
`Break` case. It could be defensive programming, so I'm going to leave it in for
the time being.
This commit is contained in:
Fintan Halpenny 2025-08-06 12:32:15 +01:00 committed by Lorenz Leutgeb
parent 1b33229dd2
commit c15288a690
1 changed files with 5 additions and 0 deletions

View File

@ -135,6 +135,11 @@ impl Announcer {
/// If there are no more nodes, then [`NoNodes`] is returned in the
/// [`ControlFlow::Break`], otherwise the [`Announcer`] is returned as-is in
/// the [`ControlFlow::Continue`].
// TODO(finto): I'm not sure this is needed with the change to the target
// logic. Since we can reach the replication factor OR the preferred seeds,
// AND the replication factor is always capped to the maximum number of
// seeds to sync with, I don't think we can ever reach a case where
// `can_continue` hits the `Break`.
pub fn can_continue(self) -> ControlFlow<NoNodes, Self> {
if self.to_sync.is_empty() {
ControlFlow::Break(NoNodes {