about summary refs log tree commit diff
path: root/tvix/nix-compat/src/derivation/mod.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-07-31T21·12+0200
committerclbot <clbot@tvl.fyi>2023-07-31T21·50+0000
commit779fad29a12e3dd5206d5a5488ddce517390132e (patch)
treecc23cac419084da20bfcd933267c7f4eca660b29 /tvix/nix-compat/src/derivation/mod.rs
parent737a6ca01e3ee017834fd310cb942079b5d10446 (diff)
refactor(tvix/nix-compat/derivation): use writer.write_all r/6454
This is more concise than a io::copy of a Cursor to bytes, and we have
everything to be written in memory.

Change-Id: I81f34666aa61aef4e16b33423ce4a69c3781efc3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8997
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/nix-compat/src/derivation/mod.rs')
-rw-r--r--tvix/nix-compat/src/derivation/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/nix-compat/src/derivation/mod.rs b/tvix/nix-compat/src/derivation/mod.rs
index 6a1eee4a81c3..6ee42bb3ed96 100644
--- a/tvix/nix-compat/src/derivation/mod.rs
+++ b/tvix/nix-compat/src/derivation/mod.rs
@@ -47,7 +47,7 @@ impl Derivation {
     ///
     /// The only errors returns are these when writing to the passed writer.
     pub fn serialize(&self, writer: &mut impl std::io::Write) -> Result<(), io::Error> {
-        io::copy(&mut io::Cursor::new(write::DERIVATION_PREFIX), writer)?;
+        writer.write_all(write::DERIVATION_PREFIX.as_bytes())?;
         write::write_char(writer, write::PAREN_OPEN)?;
 
         write::write_outputs(writer, &self.outputs)?;