chore(sterni/nix/utf8): remove decodeSafe
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
This commit is contained in:
parent
a935570a22
commit
9370ea5e33
1 changed files with 0 additions and 14 deletions
|
|
@ -209,23 +209,9 @@ let
|
||||||
) iterResult
|
) 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 {
|
in {
|
||||||
inherit
|
inherit
|
||||||
decode
|
decode
|
||||||
decodeSafe
|
|
||||||
step
|
step
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue