about summary refs log tree commit diff
path: root/tvix/derivation/src/write.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/derivation/src/write.rs')
-rw-r--r--tvix/derivation/src/write.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/tvix/derivation/src/write.rs b/tvix/derivation/src/write.rs
index 987c924fae3a..0ad1eb71e4da 100644
--- a/tvix/derivation/src/write.rs
+++ b/tvix/derivation/src/write.rs
@@ -10,6 +10,12 @@ pub const BRACKET_CLOSE: char = ']';
 pub const COMMA: char = ',';
 pub const QUOTE: char = '"';
 
+pub const COLON: &str = ":";
+pub const TEXT_COLON: &str = "text:";
+pub const SHA256_COLON: &str = "sha256:";
+pub const STORE_PATH_COLON: &str = "/nix/store:";
+pub const DOT_FILE_EXT: &str = ".drv";
+
 fn write_array_elements(
     writer: &mut impl Write,
     quote: bool,
@@ -110,7 +116,7 @@ pub fn write_input_derivations(
 
 pub fn write_input_sources(
     writer: &mut impl Write,
-    input_sources: &Vec<String>,
+    input_sources: &[String],
 ) -> Result<(), fmt::Error> {
     writer.write_char(COMMA)?;
 
@@ -138,8 +144,7 @@ pub fn write_builder(writer: &mut impl Write, builder: &str) -> Result<(), fmt::
     writer.write_str(escape_string(builder).as_str())?;
     Ok(())
 }
-
-pub fn write_arguments(writer: &mut impl Write, arguments: &Vec<String>) -> Result<(), fmt::Error> {
+pub fn write_arguments(writer: &mut impl Write, arguments: &[String]) -> Result<(), fmt::Error> {
     writer.write_char(COMMA)?;
     // convert Vec<String> to [&str]
     let v: Vec<&str> = arguments.iter().map(|x| &**x).collect();