Skip to content

Commit

Permalink
Merge pull request #3680 from wackazong/wackazong-patch-1
Browse files Browse the repository at this point in the history
Impl core::err::Error for SpawnError
  • Loading branch information
Dirbaio authored Dec 23, 2024
2 parents bb8ad91 + 4c7e1b0 commit f58efe9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions embassy-executor/src/spawner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f58efe9

Please sign in to comment.