-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlib.rs
45 lines (40 loc) · 1.44 KB
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#![warn(
clippy::unwrap_used,
missing_docs,
rust_2018_idioms,
unused_lifetimes,
unused_qualifications
)]
#![allow(clippy::single_match, rustdoc::bare_urls)]
#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
#![doc = include_str!("../README.md")]
#[cfg(all(
slabbable_impl = "stablevec",
any(slabbable_impl = "slab", slabbable_impl = "hash")
))]
compile_error!("slabbable-impl_selector: must not choose stablevec with anything else");
#[cfg(all(
slabbable_impl = "slab",
any(slabbable_impl = "stablevec", slabbable_impl = "hash")
))]
compile_error!("slabbable-impl_selector: must not choose slab with anything else");
#[cfg(all(
slabbable_impl = "hash",
any(slabbable_impl = "slab", slabbable_impl = "stablevec")
))]
compile_error!("slabbable-impl_selector: must not choose hash with anything else");
cfg_if::cfg_if! {
if #[cfg(slabbable_impl = "stablevec")] {
/// Selected impl is StableVec
pub type SelectedSlab<Item> = slabbable_stablevec::StableVecSlab<Item>;
} else if #[cfg(slabbable_impl = "slab")] {
/// Selected impl is Slab
pub type SelectedSlab<Item> = slabbable_slab::SlabSlab<Item>;
} else if #[cfg(slabbable_impl = "hash")] {
/// Selected impl is Hash
pub type SelectedSlab<Item> = slabbable_hash::HashSlab<Item>;
} else {
/// Selected default impl is Hash
pub type SelectedSlab<Item> = slabbable_hash::HashSlab<Item>;
}
}