Resolve borrowed_box lint

This commit is contained in:
Ruihan Li
2024-11-10 16:01:04 +08:00
committed by Tate, Hongliang Tian
parent c200997c9a
commit 7850f7e60a

View File

@ -157,10 +157,7 @@ impl Thread {
} }
/// Returns the associated data. /// Returns the associated data.
/// pub fn data(&self) -> &(dyn Send + Sync + Any) {
/// The return type must be borrowed box, otherwise the `downcast_ref` will fail. &*self.data
#[allow(clippy::borrowed_box)]
pub fn data(&self) -> &Box<dyn Send + Sync + Any> {
&self.data
} }
} }