From 9bd4ed57cd5cbe5e2448acc5c637c5251f48c61c Mon Sep 17 00:00:00 2001 From: Xie Yanbo Date: Tue, 18 Feb 2020 23:46:17 +0800 Subject: [PATCH] support minimum nim version 0.18.0 --- .travis.yml | 6 ++++++ leveldb.nimble | 2 +- src/leveldb.nim | 8 ++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8c36507..62e14fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,12 @@ matrix: include: - os: linux env: CHANNEL=stable + - os: linux + env: CHANNEL=0.20.2 + - os: linux + env: CHANNEL=0.19.6 + - os: linux + env: CHANNEL=0.18.0 install: - | diff --git a/leveldb.nimble b/leveldb.nimble index c143d0e..78aff6c 100644 --- a/leveldb.nimble +++ b/leveldb.nimble @@ -12,4 +12,4 @@ bin = @["leveldb"] # Dependencies -requires "nim >= 1.0.0" +requires "nim >= 0.18.0" diff --git a/src/leveldb.nim b/src/leveldb.nim index 065a0e2..83b63a6 100644 --- a/src/leveldb.nim +++ b/src/leveldb.nim @@ -193,7 +193,7 @@ iterator iter*(self: LevelDb, seek: string = "", reverse: bool = false): ( leveldb_iter_next(iterPtr) iterator iterPrefix*(self: LevelDb, prefix: string): (string, string) = - for (key, value) in iter(self, prefix, reverse = false): + for key, value in iter(self, prefix, reverse = false): if key.startsWith(prefix): yield (key, value) else: @@ -201,7 +201,7 @@ iterator iterPrefix*(self: LevelDb, prefix: string): (string, string) = iterator iterRange*(self: LevelDb, start, limit: string): (string, string) = let reverse: bool = limit < start - for (key, value) in iter(self, start, reverse = reverse): + for key, value in iter(self, start, reverse = reverse): if reverse: if key < limit: break @@ -331,7 +331,7 @@ when isMainModule: db.close() elif args[0] == "list": db = open(dbPath) - for (key, value) in db.iter(): + for key, value in db.iter(): if hex: echo key, " ", value.toHex() else: @@ -339,7 +339,7 @@ when isMainModule: db.close() elif args[0] == "keys": db = open(dbPath) - for (key, value) in db.iter(): + for key, value in db.iter(): echo key db.close() elif args[0] == "delete":