You don't need to do all that much, you can use `Option` with `into_iter` paired with `flatten` instead:
fn neighbors_with_send_capacity(&self, a: N, capacity: u128) -> impl Iterator<Item = &N> + '_ {
self.nodes
.get(&a)
.map(|m| m.keys())
.into_iter()
.flatten()
.filter(move |b| self.get_send_capacity(&a, b) >= capacity)
}
The only downside is that I believe `size_hint` is not properly forwarded.