net/tsaddr: remove ContainsFunc helpers (they're now in x/exp/slices)

x/exp/slices now has ContainsFunc (golang/go#53983) so we can delete
our versions.

Change-Id: I5157a403bfc1b30e243bf31c8b611da25e995078
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2022-12-05 18:22:53 -08:00
committed by Brad Fitzpatrick
parent 4b34c88426
commit 1598cd0361
6 changed files with 19 additions and 39 deletions

View File

@@ -11,6 +11,7 @@ import (
"errors"
"net/netip"
"golang.org/x/exp/slices"
"tailscale.com/net/tsaddr"
)
@@ -213,7 +214,7 @@ func (v IPPrefixSlice) ContainsIP(ip netip.Addr) bool {
// PrefixesContainsFunc reports whether f is true for any IPPrefix in the slice.
func (v IPPrefixSlice) ContainsFunc(f func(netip.Prefix) bool) bool {
return tsaddr.PrefixesContainsFunc(v.ж.ж, f)
return slices.ContainsFunc(v.ж.ж, f)
}
// ContainsExitRoutes reports whether v contains ExitNode Routes.