mirror of
https://github.com/zedeus/nitter.git
synced 2024-12-23 09:15:34 +00:00
Remove old Prefs type-checking code
This commit is contained in:
parent
25a6590a56
commit
68cf8216b7
|
@ -4,17 +4,6 @@ import norm/sqlite
|
|||
import prefs_impl, types
|
||||
export genUpdatePrefs
|
||||
|
||||
static:
|
||||
var pFields: seq[string]
|
||||
for id in getTypeImpl(Prefs)[2]:
|
||||
if $id[0] == "id": continue
|
||||
pFields.add $id[0]
|
||||
|
||||
let pDefs = toSeq(allPrefs()).mapIt(it.name)
|
||||
let missing = pDefs.filterIt(it notin pFields)
|
||||
if missing.len > 0:
|
||||
raiseAssert("{$1} missing from the Prefs type" % missing.join(", "))
|
||||
|
||||
template safeAddColumn(field: typedesc): untyped =
|
||||
try: field.addColumn
|
||||
except DbError: discard
|
||||
|
|
Loading…
Reference in a new issue