Fix deprecation warning when importing errorban inside the library

`errorban` module [has been deprecated][deprecation] since v0.5.0.
The library continued to use it internally, but because of that, it
was triggering its own deprecation warning. This commit splits
`errorban.nim` into two pieces: the warning and actual code.

[deprecation]: https://github.com/status-im/questionable/commit/e66cd2439b
This commit is contained in:
Nickolay Bukreyev 2022-04-03 09:08:32 +07:00 committed by markspanbroek
parent 6018fd43e0
commit 361948499b
4 changed files with 11 additions and 10 deletions

View File

@ -1,10 +1,3 @@
{.warning: "errorban is deprecated; use nimble package `upraises` instead".}
## Include this file to indicate that your module does not raise Errors.
## Disables compiler hints about unused declarations in Nim < 1.4.0
when (NimMajor, NimMinor, NimPatch) >= (1, 4, 0):
{.push raises:[].}
else:
{.push raises: [Defect].}
{.hint[XDeclaredButNotUsed]: off.}
include ./private/errorban

View File

@ -6,7 +6,7 @@ import ./indexing
import ./operators
import ./without
include ./errorban
include ./private/errorban
export options except get
export binding

View File

@ -0,0 +1,8 @@
## Include this file to indicate that your module does not raise Errors.
## Disables compiler hints about unused declarations in Nim < 1.4.0
when (NimMajor, NimMinor, NimPatch) >= (1, 4, 0):
{.push raises:[].}
else:
{.push raises: [Defect].}
{.hint[XDeclaredButNotUsed]: off.}

View File

@ -8,7 +8,7 @@ import ./operators
import ./without
import ./withoutresult
include ./errorban
include ./private/errorban
export resultsbase except ok, err, isOk, isErr, get
export binding