Skip to content

Commit

Permalink
fix: rename filename and add All method for iter
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkgos committed Dec 12, 2024
1 parent 48b405e commit 809bc07
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions iter.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//go:build go1.23

package sets

import (
"iter"
)

// Values iterator over sequences of individual values.
//
// Deprecated: use All instead.
func (s Set[T]) Values() iter.Seq[T] { return s.All() }

// All iterator over sequences of individual values.
func (s Set[T]) All() iter.Seq[T] {
return func(yield func(T) bool) {
for k := range s {
if !yield(k) {
return
}
}
}
}
File renamed without changes.
17 changes: 0 additions & 17 deletions set_iter.go

This file was deleted.

0 comments on commit 809bc07

Please sign in to comment.