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 <mail@profpatsch.de>
Autosubmit: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
This commit is contained in:
Profpatsch 2022-12-29 15:04:25 +01:00 committed by clbot
parent bb185b2c6e
commit 061a91ff8f

View file

@ -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
{