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