An expression like str::from_utf8_unchecked(bytes) should be counted as one unsafe expression. That is, just str::from_utf8_unchecked and bytes by themselves are not expressions that can meaningfully be considered unsafe. A way to see this is that there would never be a reason to write a function call as:
An expression like
str::from_utf8_unchecked(bytes)
should be counted as one unsafe expression. That is, juststr::from_utf8_unchecked
andbytes
by themselves are not expressions that can meaningfully be considered unsafe. A way to see this is that there would never be a reason to write a function call as: