mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 09:53:04 +03:00
syntax: Don't use unstable fn to convert single element to a slice
This commit is contained in:
@@ -64,7 +64,10 @@ pub fn as_slice<'a>(&'a self) -> &'a [T] {
|
||||
let result: &[T] = &[];
|
||||
result
|
||||
}
|
||||
One(ref v) => slice::ref_slice(v),
|
||||
One(ref v) => {
|
||||
// FIXME: Could be replaced with `slice::ref_slice(v)` when it is stable.
|
||||
unsafe { slice::from_raw_parts(v, 1) }
|
||||
}
|
||||
Many(ref vs) => vs
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user