diff options
Diffstat (limited to 'tvix/nix-compat/src/derivation/string_escape.rs')
-rw-r--r-- | tvix/nix-compat/src/derivation/string_escape.rs | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/tvix/nix-compat/src/derivation/string_escape.rs b/tvix/nix-compat/src/derivation/string_escape.rs deleted file mode 100644 index 0e1dbe516f73..000000000000 --- a/tvix/nix-compat/src/derivation/string_escape.rs +++ /dev/null @@ -1,17 +0,0 @@ -const STRING_ESCAPER: [(char, &str); 5] = [ - ('\\', "\\\\"), - ('\n', "\\n"), - ('\r', "\\r"), - ('\t', "\\t"), - ('\"', "\\\""), -]; - -pub fn escape_string(s: &str) -> String { - let mut s_replaced = s.to_string(); - - for escape_sequence in STRING_ESCAPER { - s_replaced = s_replaced.replace(escape_sequence.0, escape_sequence.1); - } - - format!("\"{}\"", s_replaced) -} |