ctucx.git: dns.nix

fork of https://github.com/kirelagin/dns.nix

commit c1746f77eabc7c5a8781ffaf8c3b38bc7ec17341
parent ee218b2c231997c8190ac4a0d52bb7b95634c97d
Author: Kirill Elagin <kirelagin@gmail.com>
Date: Fri, 9 Apr 2021 08:14:42 -0400

fixup: Improve writeCharacterString docs

Show the type correctly (it had a wrong why from an earlier versions)
and explain more clearly what the function actually does, in particular
that it qutoes the string, so one doesn’t need to do it manually.
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dns/util/default.nix b/dns/util/default.nix
@@ -14,8 +14,10 @@ let
       groupCount = (stringLength s - 1) / n + 1;
     in genList (i: substring (i * n) n s) groupCount;
 
-  # : str -> [str], such that each output str is <= 255 bytes
-  # (RFC 1035, 3.3)
+  # : str -> str
+  # Prepares a Nix string to be written to a zone file as a character-string
+  # literal: breaks it into chunks of 255 (per RFC 1035, 3.3) and encloses
+  # each chunk in quotation marks.
   writeCharacterString = s:
     if stringLength s <= 255
     then ''"${s}"''