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
KisaragiEffective
changed the title
taking reference on String::from_utf8 result whose argument is converted from slice
taking reference on String::from_utf8 result whose argument is converted from slice can be rewritten in borrowed version of function
Oct 9, 2023
What it does
&String::from_utf8(slice.to_vec()).unwrap_friend()
can becore::str::from_utf8(slice).unwrap_friend()
where&str
is expected.Advantage
Drawbacks
n/a
Example
Could be written as:
The text was updated successfully, but these errors were encountered: