status-im / nim-confutils

Simplified handling of command line options and config files
Apache License 2.0
64 stars 16 forks source link

rm TaintedString for string; some proc -> func #53

Closed tersec closed 2 years ago

tersec commented 2 years ago

In Nim 1.6, a TaintedString is a string:

type TaintedString* {.deprecated: "Deprecated since 1.5".} = string

so this has no effect.

In Nim 1.2 and Nim 1.4, it's a normal string unless taintMode is defined, which at least in nimbus-eth2, does not happen:

when taintMode:
  type TaintedString* = distinct string ## A distinct string type that
                                        ## is `tainted`:idx:, see `taint mode
                                        ## <manual_experimental.html#taint-mode>`_
                                        ## for details. It is an alias for
                                        ## ``string`` if the taint mode is not
                                        ## turned on.

Furthermore, the all the TaintedString/string conversions I found did no validity checking at all, just treated this as one more (in reality, nonexistent) roadbump to bulldoze through the type system. This includes all the couple dozen Status Nimbus git submodules that nimbus-eth2 uses.