Skip to content

Commit

Permalink
Fix nimble docgen error
Browse files Browse the repository at this point in the history
  • Loading branch information
demotomohiro committed Feb 28, 2024
1 parent f0f1c79 commit 2385838
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/littlesugar/staticDeque.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const MaxBitSize = sizeof(pointer) * 8 - 1
template minimumSizeUint(N: static range[1 .. MaxBitSize]): untyped =
template minimumSizeUint*(N: static range[1 .. MaxBitSize]): untyped =
# In nim-2.0.2, if this template was not exported, causes compile error.
# It is fix in nim-2.1.1.
#
# Although Nim doesn't recommend using uint, StaticDeque use it.
# Because wrap around doesn't cause problems in this use case.
# And `tail` - `head` returns correct buffer size even if `tail` < `head`.
Expand Down Expand Up @@ -76,6 +79,7 @@ proc `[]`*(x: var StaticDeque; i: Natural): var x.T {.inline.} =
## reference to it.
runnableExamples:
var a: StaticDeque[2, int]
a.addLast 10
inc(a[0])
assert a[0] == 11

Expand Down

0 comments on commit 2385838

Please sign in to comment.