From 23858384aaaa70ee8fd88301c19e92bff88c9199 Mon Sep 17 00:00:00 2001 From: demotomohiro Date: Wed, 28 Feb 2024 10:12:15 +0900 Subject: [PATCH] Fix nimble docgen error --- src/littlesugar/staticDeque.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/littlesugar/staticDeque.nim b/src/littlesugar/staticDeque.nim index e86e61b..c5c32ec 100644 --- a/src/littlesugar/staticDeque.nim +++ b/src/littlesugar/staticDeque.nim @@ -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`. @@ -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