`#[derive(HasField)]` offers less code and better ergnomic for defining
a struct with a Work in it. Hence replace the current usage of
`impl_has_work!()`.
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
---
rust/kernel/sync/completion.rs | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/rust/kernel/sync/completion.rs b/rust/kernel/sync/completion.rs
index c50012a940a3..c4af58924fe3 100644
--- a/rust/kernel/sync/completion.rs
+++ b/rust/kernel/sync/completion.rs
@@ -17,20 +17,18 @@
///
/// ```
/// use kernel::sync::{Arc, Completion};
-/// use kernel::workqueue::{self, impl_has_work, new_work, Work, WorkItem};
+/// use kernel::workqueue::{self, new_work, Work, WorkItem};
///
+/// #[derive(HasField)]
/// #[pin_data]
/// struct MyTask {
/// #[pin]
+/// #[field]
/// work: Work<MyTask>,
/// #[pin]
/// done: Completion,
/// }
///
-/// impl_has_work! {
-/// impl HasWork<Self> for MyTask { self.work }
-/// }
-///
/// impl MyTask {
/// fn new() -> Result<Arc<Self>> {
/// let this = Arc::pin_init(pin_init!(MyTask {
--
2.50.1 (Apple Git-155)