remove conditionals on nimHasUserErrors, nimNoNilSeqs2, nimNoNilSeqs (#16861)

* cleanup docs for type(nil) | type(nil); simplify nimHasUserErrors

* simplify nimNoNilSeqs2

* simplify nimNoNilSeqs

* fixup
This commit is contained in:
Timothee Cour 2021-01-29 05:30:24 -08:00 • committed by GitHub
commit 6e267d28b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 29 additions and 93 deletions

View file

@ -1150,10 +1150,7 @@ when (NimMajor, NimMinor) < (1, 3) and defined(js):
proc ssClose(s: Stream) {.compileTime.} =
var s = StringStream(s)
when defined(nimNoNilSeqs):
s.data = ""
else:
s.data = nil
s.data = ""
proc newStringStream*(s: string = ""): owned StringStream {.compileTime.} =
new(result)
@ -1253,10 +1250,7 @@ else: # after 1.3 or JS not defined
proc ssClose(s: Stream) =
var s = StringStream(s)
when defined(nimNoNilSeqs):
s.data = ""
else:
s.data = nil
s.data = ""
proc newStringStream*(s: string = ""): owned StringStream =
## Creates a new stream from the string `s`.