Examples in CodingStandardsRust.md are wrong
The section on CString
is incorrect:
-
CString::new("bl\x00ah").unwrap().into_raw()
will panic in the 'unwrap' call, it will never return a pointer of any kind, dangling or otherwise.
Also, 12cf04646c571646b726e697d66ecafad7886cf2 seems to be the result of some miscommunication with withoutboats:
-
.expect()
is literally '.unwrap()
, but with a custom panic message,' it doesn't return anOption
and is no safer than unwrap, but it is self-documenting.
Trac:
Username: cyberpunks