solar_data_structures/
lib.rs1#![doc = include_str!("../README.md")]
2#![doc(
3 html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/solar/main/assets/logo.png",
4 html_favicon_url = "https://raw.githubusercontent.com/paradigmxyz/solar/main/assets/favicon.ico"
5)]
6#![cfg_attr(docsrs, feature(doc_cfg))]
7#![cfg_attr(feature = "nightly", feature(core_intrinsics))]
8#![cfg_attr(feature = "nightly", feature(never_type))]
9#![cfg_attr(feature = "nightly", feature(rustc_attrs))]
10#![cfg_attr(feature = "nightly", feature(extern_types))]
11#![cfg_attr(feature = "nightly", allow(internal_features))]
12
13pub mod cycle;
14pub mod fmt;
15pub mod hint;
16pub mod index;
17pub mod map;
18pub mod sync;
19pub mod trustme;
20
21pub mod bit_set;
22
23mod bump_ext;
24pub use bump_ext::BumpExt;
25
26mod collect;
27pub use collect::CollectAndApply;
28
29mod never;
30pub use never::Never;
31
32mod drop_guard;
33pub use drop_guard::{DropGuard, defer};
34
35mod interned;
36pub use interned::Interned;
37
38mod thin_slice;
39pub use thin_slice::{RawThinSlice, ThinSlice};
40
41#[doc(no_inline)]
42pub use smallvec;
43
44#[macro_export]
46#[rustfmt::skip]
47macro_rules! pluralize {
48 ($x:expr) => {
50 if $x == 1 { "" } else { "s" }
51 };
52 ("has", $x:expr) => {
53 if $x == 1 { "has" } else { "have" }
54 };
55 ("is", $x:expr) => {
56 if $x == 1 { "is" } else { "are" }
57 };
58 ("was", $x:expr) => {
59 if $x == 1 { "was" } else { "were" }
60 };
61 ("this", $x:expr) => {
62 if $x == 1 { "this" } else { "these" }
63 };
64}
65
66#[inline(never)]
68#[cold]
69pub fn outline<R>(f: impl FnOnce() -> R) -> R {
70 f()
71}