Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
bobzhang committed Jun 13, 2024
1 parent 553facc commit b1c56bd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions hashset/hashset.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ pub fn HashSet::from_array[K : Hash + Eq](arr : Array[K]) -> HashSet[K] {
m
}

pub fn HashSet::of[K:Hash+Eq](arr : FixedArray[K]) -> HashSet[K]{
pub fn HashSet::of[K : Hash + Eq](arr : FixedArray[K]) -> HashSet[K] {
let m = new()
arr.iter(fn(e) { m.insert(e) })
m

}

/// Insert a key into hash set.
Expand Down Expand Up @@ -299,4 +298,4 @@ pub fn to_string[K : Show](self : HashSet[K]) -> String {
s += self.as_iter().collect().to_string()
s += ")"
s
}
}
4 changes: 2 additions & 2 deletions hashset/hashset_test.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ test "iter" {
}

test "iteri" {
let m = of(["1", "2", "3"])
let m = of(["1", "2", "3"])
let mut s = ""
let mut sum = 0
m.iteri(
Expand All @@ -131,7 +131,7 @@ test "iteri" {
}

test "clear" {
let m = of(["a", "b", "c"])
let m = of(["a", "b", "c"])
m.clear()
@assertion.assert_eq(m.size, 0)?
@assertion.assert_eq(m.capacity, 8)?
Expand Down
6 changes: 2 additions & 4 deletions hashset/test/test.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.


test "doc" {
let set= @hashset.of([3,8,1])

let set = @hashset.of([3, 8, 1])
set.insert(3)
set.insert(4)
inspect(set, content="@hashset.of([3, 4, 1, 8])")?
}
///
///
///

0 comments on commit b1c56bd

Please sign in to comment.