How to cast & T as &[T]

I want to convert &T as &[T]. How to do this

You can use std::slice::from_ref to do that.

3 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.