mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-23 22:51:07 +01:00
fix bytestring test on older rust versions
This commit is contained in:
parent
de5908bfe7
commit
5556afd524
@ -25,3 +25,4 @@ serde = { version = "1.0", optional = true }
|
||||
ahash = { version = "0.7.6", default-features = false }
|
||||
serde_json = "1.0"
|
||||
static_assertions = "1.1"
|
||||
rustversion = "1"
|
||||
|
@ -231,10 +231,7 @@ mod serde {
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use alloc::borrow::ToOwned;
|
||||
use core::{
|
||||
hash::{Hash, Hasher},
|
||||
panic::{RefUnwindSafe, UnwindSafe},
|
||||
};
|
||||
use core::hash::{Hash, Hasher};
|
||||
|
||||
use ahash::AHasher;
|
||||
use static_assertions::assert_impl_all;
|
||||
@ -242,10 +239,19 @@ mod test {
|
||||
use super::*;
|
||||
|
||||
assert_impl_all!(ByteString: Send, Sync, Unpin, Sized);
|
||||
assert_impl_all!(ByteString: UnwindSafe, RefUnwindSafe);
|
||||
assert_impl_all!(ByteString: Clone, Default, Eq, PartialOrd, Ord);
|
||||
assert_impl_all!(ByteString: fmt::Debug, fmt::Display);
|
||||
|
||||
#[rustversion::since(1.56)]
|
||||
mod above_1_56_impls {
|
||||
// `[Ref]UnwindSafe` traits were only in std until rust 1.56
|
||||
|
||||
use core::panic::{RefUnwindSafe, UnwindSafe};
|
||||
|
||||
use super::*;
|
||||
assert_impl_all!(ByteString: UnwindSafe, RefUnwindSafe);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_partial_eq() {
|
||||
let s: ByteString = ByteString::from_static("test");
|
||||
|
Loading…
Reference in New Issue
Block a user