\xXX is very misleading in Rust since it actually works exactly like \u00XX instead of the way it works in C, C++ and other languages. Example:
// this FAILS because left is [195, 191]
assert_eq!( bytes!( "\xFF"), bytes!( 255 ) );
// this SUCCEEDS
assert_eq!( bytes!( "\xFF"), bytes!( "\u00FF" ) );
I understand the reasoning behind this (Rust strings are always UTF-8), but then \xXX shouldn't exist in the language. It brings nothing but confusion and it's functionality as implemented is the same as \u00XX.
\xXXis very misleading in Rust since it actually works exactly like\u00XXinstead of the way it works in C, C++ and other languages. Example:I understand the reasoning behind this (Rust strings are always UTF-8), but then
\xXXshouldn't exist in the language. It brings nothing but confusion and it's functionality as implemented is the same as\u00XX.