-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Closed
Description
\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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels