From ff9e8743f6572bc44c084e49adc13bf293016295 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 22 Apr 2024 23:16:09 +0300 Subject: fix(tvix/eval): don't impl From for String This caught me by accident in an earlier revision of cl/11500 - I had a `NixString`, wanted to return it as a `String`, so I was naively calling `s.into()`. That unfortunately gave me the `Display` implementation of `NixString`, which quotes strings, causing an annoying error further up the stack. NixStrings are bytes, we can keep the impl From for BString, but having a `.into()` suddenly do quoting is more than unexpected. Change-Id: I5434ba94bfe6c493d0a57e68225ecc22daa4b948 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11505 Autosubmit: flokli Reviewed-by: tazjin Reviewed-by: raitobezarius Tested-by: BuildkiteCI --- tvix/eval/src/value/string.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'tvix/eval/src') diff --git a/tvix/eval/src/value/string.rs b/tvix/eval/src/value/string.rs index dd027895fd1c..ceb43f1ea5ed 100644 --- a/tvix/eval/src/value/string.rs +++ b/tvix/eval/src/value/string.rs @@ -530,11 +530,7 @@ impl<'a> From<&'a NixString> for &'a BStr { } } -impl From for String { - fn from(s: NixString) -> Self { - s.to_string() - } -} +// No impl From for String, that one quotes. impl From for BString { fn from(s: NixString) -> Self { -- cgit 1.4.1