1[workspace]
2resolver = "2"
3members = ["fuzz"]
4
5[workspace.package]
6repository = "https://github.com/winnow-rs/winnow"
7license = "MIT"
8edition = "2021"
9rust-version = "1.65.0" # MSRV
10include = [
11 "build.rs",
12 "src/**/*",
13 "Cargo.toml",
14 "Cargo.lock",
15 "LICENSE*",
16 "README.md",
17 "benches/**/*",
18 "examples/**/*"
19]
20
21[workspace.lints.rust]
22rust_2018_idioms = { level = "warn", priority = -1 }
23unreachable_pub = "warn"
24unsafe_op_in_unsafe_fn = "warn"
25unused_lifetimes = "warn"
26unused_macro_rules = "warn"
27
28[workspace.lints.clippy]
29bool_assert_comparison = "allow"
30branches_sharing_code = "allow"
31checked_conversions = "warn"
32collapsible_else_if = "allow"
33create_dir = "warn"
34dbg_macro = "warn"
35debug_assert_with_mut_call = "warn"
36doc_markdown = "warn"
37empty_enum = "warn"
38enum_glob_use = "warn"
39expl_impl_clone_on_copy = "warn"
40explicit_deref_methods = "warn"
41explicit_into_iter_loop = "warn"
42fallible_impl_from = "warn"
43filter_map_next = "warn"
44flat_map_option = "warn"
45float_cmp_const = "warn"
46fn_params_excessive_bools = "warn"
47from_iter_instead_of_collect = "warn"
48if_same_then_else = "allow"
49implicit_clone = "warn"
50imprecise_flops = "warn"
51inconsistent_struct_constructor = "warn"
52inefficient_to_string = "warn"
53infinite_loop = "warn"
54invalid_upcast_comparisons = "warn"
55large_digit_groups = "warn"
56large_stack_arrays = "warn"
57large_types_passed_by_value = "warn"
58let_and_return = "allow" # sometimes good to name what you are returning
59linkedlist = "warn"
60lossy_float_literal = "warn"
61macro_use_imports = "warn"
62mem_forget = "warn"
63mutex_integer = "warn"
64needless_continue = "warn"
65needless_for_each = "warn"
66negative_feature_names = "warn"
67path_buf_push_overwrite = "warn"
68ptr_as_ptr = "warn"
69rc_mutex = "warn"
70redundant_feature_names = "warn"
71ref_option_ref = "warn"
72rest_pat_in_fully_bound_structs = "warn"
73result_large_err = "allow"
74same_functions_in_if_condition = "warn"
75# self_named_module_files = "warn" # false-positives
76semicolon_if_nothing_returned = "warn"
77str_to_string = "warn"
78string_add = "warn"
79string_add_assign = "warn"
80string_lit_as_bytes = "warn"
81string_to_string = "warn"
82todo = "warn"
83trait_duplication_in_bounds = "warn"
84uninlined_format_args = "warn"
85verbose_file_reads = "warn"
86wildcard_imports = "allow"
87zero_sized_map_values = "warn"
88
89[package]
90name = "winnow"
91version = "0.7.6"
92description = "A byte-oriented, zero-copy, parser combinators library"
93categories = ["parsing"]
94keywords = ["parser", "parser-combinators", "parsing", "streaming", "bit"]
95autoexamples = false
96repository.workspace = true
97license.workspace = true
98edition.workspace = true
99rust-version.workspace = true
100include.workspace = true
101
102[package.metadata.docs.rs]
103features = ["unstable-doc"]
104rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"]
105
106[package.metadata.release]
107pre-release-replacements = [
108 {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1},
109 {file="CHANGELOG.md", search="\\.\\.\\.HEAD", replace="...{{tag_name}}", exactly=1},
110 {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1},
111 {file="CHANGELOG.md", search="<!-- next-header -->", replace="<!-- next-header -->\n## [Unreleased] - ReleaseDate\n", exactly=1},
112 {file="CHANGELOG.md", search="<!-- next-url -->", replace="<!-- next-url -->\n[Unreleased]: https://github.com/winnow-rs/winnow/compare/{{tag_name}}...HEAD", exactly=1},
113 {file="src/lib.rs", search="blob/v.+\\..+\\..+/CHANGELOG.md", replace="blob/v{{version}}/CHANGELOG.md", exactly=1},
114]
115
116[features]
117default = ["std"]
118alloc = []
119std = ["alloc", "memchr?/std"]
120simd = ["dep:memchr"]
121debug = ["std", "dep:anstream", "dep:anstyle", "dep:is-terminal", "dep:terminal_size"]
122unstable-recover = []
123
124unstable-doc = ["alloc", "std", "simd", "unstable-recover"]
125
126[dependencies]
127anstream = { version = "0.3.2", optional = true }
128anstyle = { version = "1.0.1", optional = true }
129is-terminal = { version = "0.4.9", optional = true }
130memchr = { version = "2.5", optional = true, default-features = false }
131terminal_size = { version = "0.4.0", optional = true }
132
133[dev-dependencies]
134proptest = "1.2.0"
135criterion = "0.5.1"
136lexopt = "0.3.0"
137term-transcript = "0.2.0"
138snapbox = { version = "0.6.21", features = ["examples"] }
139circular = "0.3.0"
140rustc-hash = "1.1.0"
141automod = "1.0.14"
142annotate-snippets = "0.11.3"
143anyhow = "1.0.86"
144
145[profile.bench]
146debug = true
147lto = true
148codegen-units = 1
149
150[[example]]
151name = "arithmetic"
152test = true
153required-features = ["alloc"]
154
155[[example]]
156name = "css"
157test = true
158required-features = ["alloc"]
159
160[[example]]
161name = "custom_error"
162test = true
163required-features = ["alloc"]
164
165[[example]]
166name = "http"
167required-features = ["alloc"]
168
169[[example]]
170name = "ini"
171test = true
172required-features = ["std"]
173
174[[example]]
175name = "json"
176test = true
177required-features = ["std"]
178
179[[example]]
180name = "ndjson"
181test = true
182required-features = ["std"]
183
184[[example]]
185name = "json_iterator"
186required-features = ["std"]
187
188[[example]]
189name = "iterator"
190
191[[example]]
192name = "s_expression"
193required-features = ["alloc"]
194
195[[example]]
196name = "string"
197required-features = ["alloc"]
198
199[[bench]]
200name = "arithmetic"
201path = "examples/arithmetic/bench.rs"
202harness = false
203required-features = ["alloc"]
204
205[[bench]]
206name = "contains_token"
207harness = false
208
209[[bench]]
210name = "find_slice"
211harness = false
212
213[[bench]]
214name = "iter"
215harness = false
216
217[[bench]]
218name = "next_slice"
219harness = false
220
221[[bench]]
222name = "number"
223harness = false
224
225[[bench]]
226name = "http"
227path = "examples/http/bench.rs"
228harness = false
229required-features = ["alloc"]
230
231[[bench]]
232name = "ini"
233path = "examples/ini/bench.rs"
234harness = false
235required-features = ["std"]
236
237[[bench]]
238name = "json"
239path = "examples/json/bench.rs"
240harness = false
241required-features = ["std"]
242
243[lints]
244workspace = true
245