diff --git a/core/src/raw/tokio_util.rs b/core/src/raw/tokio_util.rs index e68be2cf2882..2fdb533a239d 100644 --- a/core/src/raw/tokio_util.rs +++ b/core/src/raw/tokio_util.rs @@ -15,9 +15,10 @@ // specific language governing permissions and limitations // under the License. -use crate::*; +use crate::{Error, ErrorKind}; /// Parse tokio error into opendal::Error. -pub fn new_task_join_error(e: tokio::task::JoinError) -> Error { +// HACK - tokio::task::JoinError is not always present, use an existential type. +pub fn new_task_join_error(e: impl Into) -> Error { Error::new(ErrorKind::Unexpected, "tokio task join failed").set_source(e) }