Skip to content

Commit 8500794

Browse files
committed
Make SliceId a supertrait of SliceIdMut
1 parent 9aab415 commit 8500794

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

objc2/src/rc/id_traits.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ pub trait SliceId {
1616
}
1717

1818
/// Helper trait for functionality on slices containing owned [`Id`]s.
19-
pub trait SliceIdMut {
20-
/// The type of the items in the slice.
21-
type Item;
22-
19+
pub trait SliceIdMut: SliceId {
2320
/// Convert a mutable slice of mutable [`Id`]s into a mutable slice of
2421
/// mutable references.
2522
fn as_mut_slice_mut(&mut self) -> &mut [&mut Self::Item];
@@ -44,8 +41,6 @@ impl<T: Message, O: Ownership> SliceId for [Id<T, O>] {
4441
}
4542

4643
impl<T: Message> SliceIdMut for [Id<T, Owned>] {
47-
type Item = T;
48-
4944
fn as_mut_slice_mut(&mut self) -> &mut [&mut T] {
5045
let ptr = self as *mut Self as *mut [&mut T];
5146
// SAFETY: Id<T, O> and &mut T have the same memory layout, and the

0 commit comments

Comments
 (0)