Skip to content

Commit

Permalink
use toUsage instead of something inline
Browse files Browse the repository at this point in the history
  • Loading branch information
austin-denoble committed Sep 20, 2024
1 parent c1a037f commit 5e3958f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions pinecone/index_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,16 +387,9 @@ func (idx *IndexConnection) ListVectors(ctx context.Context, in *ListVectorsRequ
vectorIds[i] = &res.Vectors[i].Id
}

var usage *Usage
if res.Usage != nil {
usage = &Usage{ReadUnits: derefOrDefault(res.Usage.ReadUnits, 0)}
} else {
usage = nil
}

return &ListVectorsResponse{
VectorIds: vectorIds,
Usage: usage,
Usage: toUsage(res.Usage),
NextPaginationToken: toPaginationToken(res.Pagination),
Namespace: idx.Namespace,
}, nil
Expand Down

0 comments on commit 5e3958f

Please sign in to comment.