/
Cargo.toml
93 lines (76 loc) · 2.95 KB
/
Cargo.toml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
[package]
name = "struson"
version = "0.5.0"
authors = ["Marcono1234"]
edition = "2021"
description = "A low-level streaming JSON reader and writer"
license = "MIT OR Apache-2.0"
repository = "https://github.com/Marcono1234/struson"
keywords = ["json", "streaming", "parser"]
categories = ["parser-implementations"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
thiserror = "1.0.60"
strum = { version = "0.26.2", features = ["derive"] }
duplicate = "1.0.0"
serde = { version = "1.0.201", optional = true }
[dev-dependencies]
criterion = { version = "0.5.1", features = ["html_reports"] }
# Serde is used for comparison in benchmarks and for tests
serde = "1.0.201"
# When updating serde_json, adjust Struson Serde integration behavior to match serde_json
serde_json = "1.0.117"
# Used for verifying in allocation tests that no allocations occur in certain situations
# Specify Git revision because version with "backtrace" feature has not been released yet
assert_no_alloc = { git = "https://github.com/Windfisch/rust-assert-no-alloc.git", rev = "d31f2d5f550ce339d1c2f0c1ab7da951224b20df", features = [
"backtrace",
] }
[features]
# Feature for all experimental functionality of Struson which is likely going to change in the future,
# or might even be removed again
# Note: Might be better to use standard Rust attributes for this once they are available, see https://github.com/rust-lang/rfcs/issues/1491
experimental = []
[lints.rust]
unsafe_code = "forbid"
# The documentation discourages omitting `'_` in paths, but this lint is "allow" by default,
# see https://doc.rust-lang.org/reference/lifetime-elision.html#lifetime-elision-in-functions
elided_lifetimes_in_paths = "warn"
[lints.clippy]
# Allow needless `return` because that makes it sometimes more obvious that
# an expression is the result of the function
needless_return = "allow"
# Allow `assert_eq!(true, ...)` because in some cases it is used to check a bool
# value and not a 'flag' / 'state', and `assert_eq!` makes that more explicit
bool_assert_comparison = "allow"
# docs.rs specific configuration
[package.metadata.docs.rs]
# Document all features
all-features = true
# Set configuration flag to enable docs.rs specific doc attributes, such as `doc_auto_cfg`
# See https://stackoverflow.com/q/61417452
rustdoc-args = ["--cfg", "docsrs"]
# Cargo Profile for manual performance profiling
[profile.release-debug]
inherits = "release"
debug = true
# For all these benchmarks disable default harness (`harness = false`) because Criterion creates its own
[[bench]]
name = "reader_benchmark"
harness = false
[[bench]]
name = "reader_struct_benchmark"
harness = false
[[bench]]
name = "writer_benchmark"
harness = false
[[bench]]
name = "writer_struct_benchmark"
harness = false
[[bench]]
name = "serde_serialize_benchmark"
harness = false
required-features = ["serde"]
[[bench]]
name = "serde_deserialize_benchmark"
harness = false
required-features = ["serde"]