tvl-depot/users/Profpatsch/read-http.nix
Profpatsch e207785e1f feat(users/Profpatsch/{netencode,http-parse}): use HashMap
`U::Record` is required to be a hash map (later keys should be
ignored), so why not do the hash map immediately.

This surfaced a problem with read-http, because duplicate headers in
http are possible, but before they’d be silently ignored.
Now we merge them into a `U::List` in case, to be handled by
consumers of read-http.

Change-Id: Ifd594916f76e5acf9d08e705e0dec2c10a0081c9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2490
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-06 21:38:57 +00:00

16 lines
443 B
Nix

{ depot, pkgs, ... }:
let
read-http = depot.users.Profpatsch.writers.rustSimple {
name = "read-http";
dependencies = [
depot.users.Profpatsch.rust-crates.ascii
depot.users.Profpatsch.rust-crates.httparse
depot.users.Profpatsch.netencode.netencode-rs
depot.users.Profpatsch.arglib.netencode.rust
depot.users.Profpatsch.execline.exec-helpers
];
} (builtins.readFile ./read-http.rs);
in read-http