1[package]
2name = "tinyvec"
3description = "`tinyvec` provides 100% safe vec-like data structures."
4version = "1.9.0"
5authors = ["Lokathor <zefria@gmail.com>"]
6edition = "2018"
7license = "Zlib OR Apache-2.0 OR MIT"
8keywords = ["vec", "no_std", "no-std"]
9categories = ["data-structures", "no-std"]
10repository = "https://github.com/Lokathor/tinyvec"
11exclude = ["/.github", "/*.py", "/*.sh", "/src-backup"]
12
13[dependencies]
14tinyvec_macros = { version = "0.1", optional = true }
15# Provides `Serialize` and `Deserialize` implementations
16serde = { version = "1.0", optional = true, default-features = false }
17# Provides derived `Arbitrary` implementations
18arbitrary = { version = "1", optional = true }
19# Provides `BorshSerialize` and `BorshDeserialize implementations
20borsh = { version = "1.2.0", optional = true, default-features = false }
21# Implements the trait `Array` for `GenericArray` struct.
22generic-array = { version = "1.1.1", optional = true, default-features = false }
23
24
25[features]
26default = []
27
28# Provide things that utilize the `alloc` crate, namely `TinyVec`.
29alloc = ["tinyvec_macros"]
30
31# Provide things that require Rust's `std` module
32std = ["alloc"]
33
34# (not part of Vec!) Extra methods to let you grab the slice of memory after the
35# "active" portion of an `ArrayVec` or `SliceVec`.
36grab_spare_slice = []
37
38# obsolete feature that has to stay for semver reasons
39rustc_1_40 = []
40
41# features that require rustc 1.55
42# use const generics to implement Array for all array lengths
43rustc_1_55 = ["rustc_1_40"]
44
45# features that require rustc 1.57
46# add try_reserve functions to types that heap allocate.
47rustc_1_57 = ["rustc_1_55"]
48
49# features that require rustc 1.61
50# add retain_mut function to TinyVec
51rustc_1_61 = ["rustc_1_57"]
52
53# We're done with per-version featuring, this feature opts in to all the
54# abilities of the latest release of Stable rust, and we don't need a million
55# features forever now.
56latest_stable_rust = ["rustc_1_61"]
57
58# allow use of nightly feature `slice_partition_dedup`,
59# will become useless once that is stabilized:
60# https://github.com/rust-lang/rust/issues/54279
61nightly_slice_partition_dedup = []
62
63# allow use of nightly feature `debugger_visualizer`,
64# will become useless once that is stabilized:
65# https://github.com/rust-lang/rust/issues/95939
66debugger_visualizer = []
67
68# EXPERIMENTAL: Not part of SemVer. It adds `core::fmt::Write` to `ArrayVec`
69# and `SliceVec`. It works on Stable Rust, but Vec normally supports the
70# `std::io::Write` trait instead of `core::fmt::Write`, so we're keeping it as
71# an experimental impl only for now.
72experimental_write_impl = []
73
74# Some benchmarks are optimized away with the stable black_box function
75# which is based on read_volatile. This feature requires inline assembly
76# and thus a nightly compiler, but is only used in benchmarks.
77real_blackbox = ["criterion/real_blackbox"]
78
79[package.metadata.docs.rs]
80features = ["alloc", "std", "grab_spare_slice", "latest_stable_rust", "serde", "borsh"]
81rustdoc-args = ["--cfg","docs_rs"]
82
83[package.metadata.playground]
84features = ["alloc", "std", "grab_spare_slice", "latest_stable_rust", "serde", "borsh"]
85
86[profile.bench]
87debug = 2
88
89[workspace]
90members = ["fuzz"]
91
92[dev-dependencies]
93criterion = "0.3.0"
94serde_test = "1.0"
95smallvec = "1"
96debugger_test = "0.1"
97debugger_test_parser = "0.1"
98
99[[test]]
100name = "tinyvec"
101required-features = ["alloc", "std"]
102
103[[bench]]
104name = "macros"
105harness = false
106required-features = ["alloc"]
107
108[[bench]]
109name = "smallvec"
110harness = false
111required-features = ["alloc", "real_blackbox"]
112
113[[test]]
114path = "tests/debugger_visualizer.rs"
115name = "debugger_visualizer"
116required-features = ["debugger_visualizer"]
117test = false
118