1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-23 20:51:06 +01:00

fix bytestring test on older rust versions

This commit is contained in:
Rob Ede 2021-11-28 01:19:57 +00:00
parent de5908bfe7
commit 5556afd524
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
2 changed files with 12 additions and 5 deletions

View File

@ -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"

View File

@ -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");