-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected behaviour of the str::from
builtin function
#169
Comments
The Value::String(string) => write!(f, "\"{}\"", string), The extra quotation marks above are the issue and does not follow the standard |
I see, thanks! Yeah, formatting a string with quotation marks was
deliberate, but adding quotation marks around a string in `str::from` was
not. I would be happy about a pull request that fixes this issue!
…On Fri, 11 Oct 2024, 1.00 VianneyRousset, ***@***.***> wrote:
The str::from builtin function uses the Value::to_string implemented for
the Display trait:
Value::String(string) => write!(f, "\"{}\"", string),
The extra quotation marks above are the issue and does not follow the
standard fmt() of a string. I guess that was a deliberate choice?
—
Reply to this email directly, view it on GitHub
<#169 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AASATXUJNLAGNJTD72DFDNLZ232IVAVCNFSM6AAAAABPXOPPGSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBWGEYTKMZSG4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Done in #170. Please note the choice has been made that applying Therefore, |
Thanks for fixing this! I'll hopefully be able to make a release during the next week. |
The
str::from
builtin function is useful to convert value to a string, however the latter has an unexpected output when a string is given as argument."foo " + str::from(42)
returnsfoo 42
which is fine."foo " + str::from("bar")
returnsfoo "bar"
, when it should befoo bar
.The text was updated successfully, but these errors were encountered: