You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To write a double-quote (") in a string literal, once needs to escape with with a backslash like so:
let s = "double-quote: \"";
This is because it is also the delimiter of a string.
However, in character literals a single-quote (') is the delimiter and still, '"' works without warnings:
assert_eq!('\"','"');// always true
I think this might be a bug since it is not really needed to have an escaped double-quote in character literals or was it implemented as a helpful routine?
The same is true for strings and a single-quote!
assert_eq!("\'","'");// always true
I am very sorry if this was explicitly wanted behaviour!
The text was updated successfully, but these errors were encountered:
To write a double-quote (") in a string literal, once needs to escape with with a backslash like so:
This is because it is also the delimiter of a string.
However, in character literals a single-quote (') is the delimiter and still, '"' works without warnings:
I think this might be a bug since it is not really needed to have an escaped double-quote in character literals or was it implemented as a helpful routine?
The same is true for strings and a single-quote!
I am very sorry if this was explicitly wanted behaviour!
The text was updated successfully, but these errors were encountered: