Skip to content

Commit 4766588

Browse files
authored
hybrid-array: remove Array::ref_* prefixes (#1037)
Use the same names `GenericArray` did: - `Array::from_slice` - `Array::from_mut_slice` The goal is to deprecate these methods anyway, so we should use the same names as `GenericArray` to ease migrating off of it.
1 parent 5abf0fd commit 4766588

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hybrid-array/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ where
102102
// TODO(tarcieri): deprecate this before the v0.2 release
103103
// #[deprecated(since = "0.2.0", note = "use TryFrom instead")]
104104
#[inline]
105-
pub fn ref_from_slice(slice: &[T]) -> &Self {
105+
pub fn from_slice(slice: &[T]) -> &Self {
106106
slice.try_into().expect("slice length mismatch")
107107
}
108108

@@ -114,7 +114,7 @@ where
114114
// TODO(tarcieri): deprecate this before the v0.2 release
115115
// #[deprecated(since = "0.2.0", note = "use TryFrom instead")]
116116
#[inline]
117-
pub fn ref_from_mut_slice(slice: &mut [T]) -> &mut Self {
117+
pub fn from_mut_slice(slice: &mut [T]) -> &mut Self {
118118
slice.try_into().expect("slice length mismatch")
119119
}
120120

0 commit comments

Comments
 (0)