Skip to content

Commit

Permalink
Add test asserting that StatsError is Sync & Send
Browse files Browse the repository at this point in the history
  • Loading branch information
FreezyLemon authored and YeungOnion committed Apr 29, 2024
1 parent ccf8ec8 commit 4d94513
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,18 @@ impl fmt::Display for StatsError {
}
}
}

#[cfg(test)]
mod tests {
use super::*;

fn assert_sync<T: Sync>() {}
fn assert_send<T: Send>() {}

#[test]
fn test_sync_send() {
// Error types should implement Sync and Send
let _ = assert_sync::<StatsError>();
let _ = assert_send::<StatsError>();
}
}

0 comments on commit 4d94513

Please sign in to comment.