all repos — searchix @ 08a05b653047f4b45d1a4213e0af94b3dda1d4e0

Search engine for NixOS, nix-darwin, home-manager and NUR users

refactor(importer): use interfaces, not generics

Alan Pearce
commit

08a05b653047f4b45d1a4213e0af94b3dda1d4e0

parent

9327a79febcce1056f2935918a947adb6f80a5c8

1 file changed, 6 insertions(+), 6 deletions(-)

changed files
M internal/storage/store.gointernal/storage/store.go
@@ -181,20 +181,20 @@
return doc, nil } -func MakeSourceExporter[I nix.Importable]( +func MakeSourceExporter( store *Store, source *config.Source, -) func(context.Context) (<-chan I, <-chan error) { - return func(_ context.Context) (<-chan I, <-chan error) { - results := make(chan I) +) func(context.Context) (<-chan nix.Importable, <-chan error) { + return func(_ context.Context) (<-chan nix.Importable, <-chan error) { + results := make(chan nix.Importable) errs := make(chan error) go func() { defer close(results) defer close(errs) - var obj I - objs := make([]I, 0, BatchSize) + var obj nix.Importable + objs := make([]nix.Importable, 0, BatchSize) node := store.From(source.Key) count, err := node.Count(&obj) if err != nil {