Merge pull request #3680 from wackazong/wackazong-patch-1

Impl core::err::Error for SpawnError
This commit is contained in:
Dario Nieuwenhuis 2024-12-23 10:29:16 +00:00 committed by GitHub
commit f58efe9c62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -62,6 +62,16 @@ pub enum SpawnError {
Busy,
}
impl core::fmt::Display for SpawnError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
SpawnError::Busy => write!(f, "Busy"),
}
}
}
impl core::error::Error for SpawnError {}
/// Handle to spawn tasks into an executor.
///
/// This Spawner can spawn any task (Send and non-Send ones), but it can