Commit 26d672e
authored
Restore prettyplease feature gate to bindgen library crate (#2537)
This is a partial revert of these two PRs:
- #2491
- #2505
Allow formatting of generated bindings and the inclusion of the
`prettyplease` dependency to be optional when depending on bindgen as a
library.
`prettyplease` remains required and enabled by bindgen-cli.
In a project I maintain, `bindgen` is used in a build script to generate
bindings for a native C library. Those bindings are written to `OUT_DIR`
and are `include!`'d into the crate sources; these bindings don't need
to be formatted.
See for additional context:
- #2491 (comment)
- #2491 (comment)
- #2491 (comment)
I tested all of the following locally:
```shell
cd bindgen
cargo check
cargo check --no-default-features
cargo check --no-default-features --features prettyplease
```
The CI steps added in #2506 should be sufficient
for maintaining the correctness of these conditional compilation features.1 parent df984e2 commit 26d672e
3 files changed
+9
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
| |||
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
| 193 | + | |
192 | 194 | | |
193 | 195 | | |
194 | 196 | | |
| |||
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
| 205 | + | |
203 | 206 | | |
204 | 207 | | |
205 | 208 | | |
| |||
964 | 967 | | |
965 | 968 | | |
966 | 969 | | |
| 970 | + | |
967 | 971 | | |
968 | 972 | | |
969 | 973 | | |
| |||
0 commit comments