### What it does `&String::from_utf8(slice.to_vec()).unwrap_friend()` can be `core::str::from_utf8(slice).unwrap_friend()` where `&str` is expected. ### Advantage - Remove additional allocation - Reduces instruction count by 2x on release mode ([godbolt](https://rust.godbolt.org/z/P9Mqas753)) ### Drawbacks n/a ### Example ```rust fn opaque(buf: &mut [u8]) {} let mut foo = String::new(); let slice = [0u8; 1024]; opaque(&mut slice); let ref_str: &str = &String::from_utf8(slice.to_vec()).expect("not UTF-8"); ``` Could be written as: ```rust let ref_str: &str = core::str::from_utf8(slice).expect("not UTF-8"); ``` <!-- TRIAGEBOT_START --> <!-- TRIAGEBOT_ASSIGN_START --> <!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"y21"}$$TRIAGEBOT_ASSIGN_DATA_END --> <!-- TRIAGEBOT_ASSIGN_END --> <!-- TRIAGEBOT_END -->