feat(tvix/nix-compat/wire): have write_bytes accept AsRef<[u8]> payloads

This includes String, &str etc. An example testcase with &str is
provided.

Change-Id: I900186d6ceb52f52bd41ef4596524c1f5b52470b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11376
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: picnoir picnoir <picnoir@alternativebit.fr>
This commit is contained in:
Florian Klink 2024-04-08 00:46:26 +03:00 committed by clbot
parent acee489866
commit 71a3855f09
2 changed files with 21 additions and 5 deletions

View file

@ -165,7 +165,7 @@ where
// good idea.
debug!("write version");
// Plain str padded to 64 bits.
bytes::write_bytes(&mut conn, "2.3.17".as_bytes()).await?;
bytes::write_bytes(&mut conn, "2.3.17").await?;
conn.flush().await?;
}
if protocol_minor >= 35 {