about summary refs log tree commit diff
path: root/users/Profpatsch
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2022-12-29T14·04+0100
committerclbot <clbot@tvl.fyi>2022-12-29T15·30+0000
commit061a91ff8fc9b07288a99ab94b9d382fb73e3709 (patch)
treed24156912b078a06a485d64b34fb3aabf82e46ce /users/Profpatsch
parentbb185b2c6eb8c4e035cddb61be772169df1b0139 (diff)
refactor(users/Profpatsch/netstring): use toplevel aliases as impls r/5537
Apparently I had forgotten that these already exist on the toplevel.
At one point I should unify the two namespaces, but for now at least
acknowledge that they are the same functions.

Change-Id: Ie7d14de0b65f6c750d97630798c65f777b3eda8c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7673
Reviewed-by: Profpatsch <mail@profpatsch.de>
Autosubmit: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/Profpatsch')
-rw-r--r--users/Profpatsch/netstring/default.nix9
1 files changed, 2 insertions, 7 deletions
diff --git a/users/Profpatsch/netstring/default.nix b/users/Profpatsch/netstring/default.nix
index e85cf24dd8e6..047fe6bae14d 100644
--- a/users/Profpatsch/netstring/default.nix
+++ b/users/Profpatsch/netstring/default.nix
@@ -1,16 +1,11 @@
 { lib, pkgs, depot, ... }:
 let
-  toNetstring = s:
-    "${toString (builtins.stringLength s)}:${s},";
+  toNetstring = depot.nix.netstring.fromString;
 
   toNetstringList = xs:
     lib.concatStrings (map toNetstring xs);
 
-  toNetstringKeyVal = attrs:
-    lib.concatStrings
-      (lib.mapAttrsToList
-        (k: v: toNetstring (toNetstring k + toNetstring v))
-        attrs);
+  toNetstringKeyVal = depot.nix.netstring.attrsToKeyValList;
 
   python-netstring = depot.users.Profpatsch.writers.python3Lib
     {