about summary refs log tree commit diff
path: root/users/sterni/nix/utf8/default.nix
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2021-11-23T18·06+0100
committersterni <sternenseemann@systemli.org>2021-11-25T11·15+0100
commit9370ea5e3303359a9c25417b0b8210d174e167e5 (patch)
tree508d7bbf5f98b3c77838b5ee2d2a31879693036d /users/sterni/nix/utf8/default.nix
parenta935570a22db6418da8b579b32a6fe3ace06d6ad (diff)
chore(sterni/nix/utf8): remove decodeSafe r/3090
This is not really used anywhere and kind of useless. A better
decodeSafe would never return null and instead make use of replacement
characters to represent invalid bytes in the input.

Change-Id: Ib4111529bf0e472dbfa720a5d0b939c2d2511de5
Diffstat (limited to 'users/sterni/nix/utf8/default.nix')
-rw-r--r--users/sterni/nix/utf8/default.nix14
1 files changed, 0 insertions, 14 deletions
diff --git a/users/sterni/nix/utf8/default.nix b/users/sterni/nix/utf8/default.nix
index c4a3e8eb03b3..99947c5a8c2c 100644
--- a/users/sterni/nix/utf8/default.nix
+++ b/users/sterni/nix/utf8/default.nix
@@ -209,23 +209,9 @@ let
       ) iterResult
     );
 
-  /* Decodes an UTF-8 string, but doesn't throw on error.
-     Instead it returns null.
-
-     Type: string -> ( [ integer ] | null)
-  */
-  decodeSafe = s:
-    let
-      res = builtins.tryEval (decode s);
-    in
-      if res.success
-      then res.value
-      else null;
-
 in {
   inherit
     decode
-    decodeSafe
     step
     ;
 }