Skip to content

Commit

Permalink
Fix formatting in priority_queue.mbt and vec.mbt
Browse files Browse the repository at this point in the history
  • Loading branch information
bobzhang committed Mar 25, 2024
1 parent 34b2317 commit 605f4a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion priority_queue/priority_queue.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ test "clear" {
/// let is_empty = queue.is_empty() // true
/// ```
pub fn is_empty[T](self : PriorityQueue[T]) -> Bool {
self.len == 0
self.len == 0
}

test "is_empty" {
Expand Down
2 changes: 1 addition & 1 deletion priority_queue/types.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ struct PriorityQueue[T] {
min : Bool
mut len : Int
mut top : Node[T]
}
}
9 changes: 4 additions & 5 deletions vec/vec.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ pub fn to_string[T : Show](self : Vec[T]) -> String {
return "Vec::[]"
}
let first = self.buf[0]
for i = 1, init = "Vec::[\(first)"; ; {
if i < self.len {
let cur = self.buf[i]
continue i + 1, "\(init),\(cur)"
} else {
for i = 1, init = "Vec::[\(first)" {
if i >= self.len {
break "\(init)]"
}
let cur = self.buf[i]
continue i + 1, "\(init),\(cur)"
}
}

Expand Down

0 comments on commit 605f4a5

Please sign in to comment.