simplify icon caching and homepage item override

This commit is contained in:
yusing
2025-01-21 06:16:00 +08:00
parent d429374924
commit 8b1a3a31ff
21 changed files with 395 additions and 331 deletions

View File

@@ -18,3 +18,11 @@ func Intersect[T comparable, Slice ~[]T](slice1 Slice, slice2 Slice) Slice {
return result
}
// Slice returns a slice of the first n elements in slice like javascript's slice.
func Slice[T any](slice []T, n int) []T {
if n >= len(slice) {
return slice
}
return slice[:n]
}