patched_stdlib(parsejson): resolve `CStringConv` warnings (#445)
patched_stdlib(parsejson): resolve `CStringConv` warnings (#445)

After the upgrade to Nim 1.6.0 in commit 761936b99c58, a regular
`nimble build` would produce these warnings:

    /foo/configlet/src/patched_stdlib/parsejson.nim(237, 37) Warning:
    implicit conversion to 'cstring' from a non-const location: my.buf;
    this will become a compile time error in the future [CStringConv]

    /foo/configlet/src/patched_stdlib/parsejson.nim(247, 39) Warning:
    implicit conversion to 'cstring' from a non-const location: my.buf;
    this will become a compile time error in the future [CStringConv]

I authored a commit [1] in the `nim-lang/Nim` repo that resolves the
most visible CStringConv warnings, including these in parsejson, by
making the cstring conversion explicit. Let's update configlet's copy of
parsejson without waiting for a Nim version bump, so that we no longer
see these CStringConv warnings when compiling configlet.

As a reminder, we maintain our own copy of std/json and std/parsejson in
the configlet repo so that we can forbid comments and trailing commas in
JSON. This is necessary for Exercism - see 15c84037fadc for details.

As background, the Nim manual says that an implicit conversion to
cstring will eventually not be allowed [2]:

    A Nim `string` is implicitly convertible to `cstring` for convenience.

    [...]

    Even though the conversion is implicit, it is not *safe*: The garbage collector
    does not consider a `cstring` to be a root and may collect the underlying
    memory. For this reason, the implicit conversion will be removed in future
    releases of the Nim compiler. Certain idioms like conversion of a `const` string
    to `cstring` are safe and will remain to be allowed.

And from Nim 1.6.0, such a conversion triggers a warning [3]:

    A dangerous implicit conversion to `cstring` now triggers a `[CStringConv]` warning.
    This warning will become an error in future versions! Use an explicit conversion
    like `cstring(x)` in order to silence the warning.

[1] https://github.com/nim-lang/Nim/commit/e8657c710776
[2] https://github.com/nim-lang/Nim/blob/e8657c710776/doc/manual.md#cstring-type
[3] https://github.com/nim-lang/Nim/blob/e8657c710776/changelogs/changelog_1_6_0.md#type-system

exercism/configlet