Skip to content

Commit 2c477ec

Browse files
committed
Drop type parameter T from PointerWrapper trait.
Signed-off-by: Sumera Priyadarsini <[email protected]>
1 parent 0653973 commit 2c477ec

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

rust/kernel/types.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ macro_rules! cstr {
8080
/// It can eventually be converted back into the object. This is used to store objects as pointers
8181
/// in kernel data structures, for example, an implementation of [`FileOperations`] in `struct
8282
/// file::private_data`.
83-
pub trait PointerWrapper<T> {
83+
pub trait PointerWrapper {
8484
/// Returns the raw pointer.
8585
fn into_pointer(self) -> *const T;
8686

@@ -92,7 +92,7 @@ pub trait PointerWrapper<T> {
9292
unsafe fn from_pointer(ptr: *const T) -> Self;
9393
}
9494

95-
impl<T> PointerWrapper<T> for Box<T> {
95+
impl<T> PointerWrapper for Box<T> {
9696
fn into_pointer(self) -> *const T {
9797
Box::into_raw(self)
9898
}
@@ -102,7 +102,7 @@ impl<T> PointerWrapper<T> for Box<T> {
102102
}
103103
}
104104

105-
impl<T: RefCounted> PointerWrapper<T> for Ref<T> {
105+
impl<T: RefCounted> PointerWrapper for Ref<T> {
106106
fn into_pointer(self) -> *const T {
107107
Ref::into_raw(self)
108108
}
@@ -112,7 +112,7 @@ impl<T: RefCounted> PointerWrapper<T> for Ref<T> {
112112
}
113113
}
114114

115-
impl<T> PointerWrapper<T> for Arc<T> {
115+
impl<T> PointerWrapper for Arc<T> {
116116
fn into_pointer(self) -> *const T {
117117
Arc::into_raw(self)
118118
}
@@ -122,7 +122,7 @@ impl<T> PointerWrapper<T> for Arc<T> {
122122
}
123123
}
124124

125-
impl<T, W: PointerWrapper<T> + Deref> PointerWrapper<T> for Pin<W> {
125+
impl<T, W: PointerWrapper + Deref> PointerWrapper for Pin<W> {
126126
fn into_pointer(self) -> *const T {
127127
// SAFETY: We continue to treat the pointer as pinned by returning just a pointer to it to
128128
// the caller.

0 commit comments

Comments
 (0)