From 061a91ff8fc9b07288a99ab94b9d382fb73e3709 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Thu, 29 Dec 2022 15:04:25 +0100 Subject: refactor(users/Profpatsch/netstring): use toplevel aliases as impls 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 Autosubmit: Profpatsch Tested-by: BuildkiteCI --- users/Profpatsch/netstring/default.nix | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/users/Profpatsch/netstring/default.nix b/users/Profpatsch/netstring/default.nix index e85cf24dd8..047fe6bae1 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 { -- cgit 1.4.1