Compare commits
No commits in common. "main" and "v0.0.10" have entirely different histories.
12
of.go
12
of.go
@ -14,15 +14,3 @@ func OfMap[K comparable, V, T any](m map[K]V, unmapper func(K, V) T) []T {
|
|||||||
}
|
}
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmapKey is an unmapper function which returns the map key only
|
|
||||||
// and discards its value. It is supposed to be used with OfMap
|
|
||||||
func UnmapKey[K comparable, V any](key K, _ V) K {
|
|
||||||
return key
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmapValue is an unmapper function which returns the map value only
|
|
||||||
// and discards its key. It is supposed to be used with OfMap
|
|
||||||
func UnmapValue[K comparable, V any](_ K, value V) V {
|
|
||||||
return value
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user