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:
Janito Vaqueiro Ferreira Filho 2021-05-21 21:41:26 +00:00
parent 4e8efd0cec
commit b891a96a6d
1 changed files with 2 additions and 2 deletions

View File

@ -335,7 +335,7 @@ where
fn validate_addrs(
addrs: impl IntoIterator<Item = MetaAddr>,
last_seen_limit: DateTime<Utc>,
) -> impl IntoIterator<Item = MetaAddr> {
) -> impl Iterator<Item = MetaAddr> {
// Note: The address book handles duplicate addresses internally,
// 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
// response (#1869)
addrs
addrs.into_iter()
}