Improve ergonomics by returning `impl Iterator`
Returning `impl IntoIterator` means that the caller will always be forced to call `.into_iter()`, and returning `impl Iterator` still allows them to call `.into_iter()` because it becomes the identity function.
This commit is contained in:
parent
4e8efd0cec
commit
b891a96a6d
|
@ -335,7 +335,7 @@ where
|
||||||
fn validate_addrs(
|
fn validate_addrs(
|
||||||
addrs: impl IntoIterator<Item = MetaAddr>,
|
addrs: impl IntoIterator<Item = MetaAddr>,
|
||||||
last_seen_limit: DateTime<Utc>,
|
last_seen_limit: DateTime<Utc>,
|
||||||
) -> impl IntoIterator<Item = MetaAddr> {
|
) -> impl Iterator<Item = MetaAddr> {
|
||||||
// Note: The address book handles duplicate addresses internally,
|
// Note: The address book handles duplicate addresses internally,
|
||||||
// so we don't need to de-duplicate addresses here.
|
// so we don't need to de-duplicate addresses here.
|
||||||
|
|
||||||
|
@ -348,5 +348,5 @@ fn validate_addrs(
|
||||||
// - Zebra should limit the number of addresses it uses from a single Addrs
|
// - Zebra should limit the number of addresses it uses from a single Addrs
|
||||||
// response (#1869)
|
// response (#1869)
|
||||||
|
|
||||||
addrs
|
addrs.into_iter()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue