match address {
IpAddr::V4(_) => TYPE_A,
IpAddr::V6(_) => TYPE_AAAA,
}
in multiple places, although this is a very simple operation, it could be extracted into a function (which is what this PR does).
I'm not really sure if the function name ip_address_to_type and its location are appropriate.
I have seen the repeated usage of
in multiple places, although this is a very simple operation, it could be extracted into a function (which is what this PR does). I'm not really sure if the function name
ip_address_to_type
and its location are appropriate.