about summary refs log tree commit diff
path: root/tvix/nix-compat/src/derivation/write.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-08-01T10·21+0200
committerflokli <flokli@flokli.de>2023-08-19T10·54+0000
commit39efe50311e459a2011d0abd4d06e1147ca38509 (patch)
treef17c5d1669e367f3463af61c0f5bacef22243495 /tvix/nix-compat/src/derivation/write.rs
parent72fc4fee534c2b28016dd004671b11bebc1b8c68 (diff)
refactor(tvix/nix-compat/derivation/escape): move to Vec<u8> r/6487
We only need bstr::ByteSlice to be able to use replace, it doesn't need
to return a BString.

Change-Id: I811948436fb89652e880970c2c05356183f3e439
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9084
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Diffstat (limited to 'tvix/nix-compat/src/derivation/write.rs')
-rw-r--r--tvix/nix-compat/src/derivation/write.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/nix-compat/src/derivation/write.rs b/tvix/nix-compat/src/derivation/write.rs
index d84992a3cbc4..538183ac6513 100644
--- a/tvix/nix-compat/src/derivation/write.rs
+++ b/tvix/nix-compat/src/derivation/write.rs
@@ -3,7 +3,7 @@
 //!
 //! [ATerm]: http://program-transformation.org/Tools/ATermFormat.html
 
-use crate::derivation::escape::escape_bstr;
+use crate::derivation::escape::escape_bytes;
 use crate::derivation::output::Output;
 use bstr::BString;
 use std::{
@@ -42,7 +42,7 @@ pub(crate) fn write_field<S: AsRef<[u8]>>(
     if !escape {
         writer.write_all(s.as_ref())?;
     } else {
-        writer.write_all(&escape_bstr(s.as_ref()))?;
+        writer.write_all(&escape_bytes(s.as_ref()))?;
     }
 
     write_char(writer, QUOTE)?;