Function std::slice::from_ref

1.28.0 (const: 1.63.0) · source ·
pub const fn from_ref<T>(s: &T) -> &[T]
Expand description

将引用转换为 T 转换为长度为 1 的切片 (不进行复制)。