Skip to content

Commit

Permalink
fix: unused warning
Browse files Browse the repository at this point in the history
  • Loading branch information
levovix0 committed Aug 16, 2022
1 parent 4b70dd2 commit 742a1f2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion boxes.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ license = "MIT"
srcDir = "src"

requires "nim >= 1.6.6"
requires "vmath", "bumpy", "fusion"
requires "bumpy" #, "vmath"
requires "fusion"

task test, "run tests": # needed because tests uses libraries, that is not dependencies
exec "nim c --hints:off -r tests/tests"
3 changes: 2 additions & 1 deletion src/boxes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ proc makeBox(args: seq[NimNode]): NimNode =
buildAst: blockStmt empty(), stmtList do:
letSection:
identDefs:
ident"box"
pragmaExpr ident"box":
pragma ident"used" # todo: do not declare box, if it is not used
empty()
box

Expand Down
2 changes: 1 addition & 1 deletion tests/tests.nim
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test "window":
ctx.fillStyle = rgba(64, 64, 255, 255)
ctx.fillRect b.box(centerY = b.center + 100, left = b.right + 2.5, w = 5, h = 50)

window.drawImage image.data
window.drawImage image.data.toBgrx, ivec2(image.width.int32, image.height.int32)

window.onKeyup = proc(e: KeyEvent) =
if e.key == Key.escape:
Expand Down

0 comments on commit 742a1f2

Please sign in to comment.