diff --git a/tvix/nix-compat/src/derivation/write.rs b/tvix/nix-compat/src/derivation/write.rs index 5e1aefa16..01e533ced 100644 --- a/tvix/nix-compat/src/derivation/write.rs +++ b/tvix/nix-compat/src/derivation/write.rs @@ -174,13 +174,15 @@ pub fn write_arguments(writer: &mut impl Write, arguments: &[String]) -> Result< Ok(()) } -pub fn write_enviroment( - writer: &mut impl Write, - environment: &BTreeMap, -) -> Result<(), io::Error> { +pub fn write_enviroment(writer: &mut impl Write, environment: E) -> Result<(), io::Error> +where + E: IntoIterator, + K: AsRef<[u8]>, + V: AsRef<[u8]>, +{ write_char(writer, BRACKET_OPEN)?; - for (i, (k, v)) in environment.iter().enumerate() { + for (i, (k, v)) in environment.into_iter().enumerate() { if i > 0 { write_char(writer, COMMA)?; }