Skip to content

Commit

Permalink
fix(compat): support future module relocation in nim devel (#31)
Browse files Browse the repository at this point in the history
The next release of nim will see `future` moving to `sugar`.  Currently a deprecation warning appears while using this `glob` on `devel`, and well, I won't be able to sleep that well if I don't PR this.

Thanks for writing this library. 🎉
  • Loading branch information
skellock authored and haltcase committed Sep 24, 2018
1 parent 1fa54df commit ffd65d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/glob.nim
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ will potentially be added in the future, for example:
]##

import future
when (NimMajor, NimMinor, NimPatch) >= (0, 18, 1):
from sugar import `=>`, `->`
else:
from future import `=>`, `->`
import os
import strutils
from sequtils import toSeq
Expand Down
5 changes: 4 additions & 1 deletion tests.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import future
when (NimMajor, NimMinor, NimPatch) >= (0, 18, 1):
from sugar import `=>`, `->`
else:
from future import `=>`, `->`
import ospaths
from os import createDir, removeDir, getCurrentDir
from algorithm import sortedByIt
Expand Down

0 comments on commit ffd65d3

Please sign in to comment.