Commit 8c72d46
committed
Merge rust-bitcoin#5006: Remove the implicit lifetime name requirement in the encoder_newtype macro
cf99839 consensus_encoding: API updates (Nick Johnson)
9547fe3 consensus_encoding: remove implicit lifetime name (Nick Johnson)
Pull request description:
Inspired by rust-bitcoin#5003 (which I believe is the [elidable_lifetime_names](https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names) clippy rule) I experimented with some lifetime elision in the encoder_newtype macro. This drops the implicit requirement that the encoder struct's lifetime be called `'e` to match the internal macro's usage.
This might be a subtle change in the requirements themselves since they are no longer explicitly tied together, however, I haven't been able to come up with a unit test to break that in any way.
ACKs for top commit:
apoelstra:
ACK cf99839; successfully ran local tests; neat!
Tree-SHA512: 5ce2a32017bf66e21bce95b38aeb6c4e4e317a68c5adc48c03cd815bc3efb67638d04eb4e42980231656761be91b21e0750efe293ea6c506cf3c1631be0f983fFile tree
4 files changed
+37
-27
lines changed- api/units
- consensus_encoding
- src/encode
- tests
4 files changed
+37
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
| |||
1242 | 1246 | | |
1243 | 1247 | | |
1244 | 1248 | | |
1245 | | - | |
1246 | | - | |
1247 | | - | |
1248 | | - | |
1249 | 1249 | | |
1250 | 1250 | | |
1251 | 1251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
219 | | - | |
220 | | - | |
| 218 | + | |
221 | 219 | | |
222 | 220 | | |
223 | 221 | | |
| |||
239 | 237 | | |
240 | 238 | | |
241 | 239 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
| 240 | + | |
| 241 | + | |
251 | 242 | | |
252 | 243 | | |
253 | 244 | | |
| |||
261 | 252 | | |
262 | 253 | | |
263 | 254 | | |
264 | | - | |
| 255 | + | |
265 | 256 | | |
266 | 257 | | |
267 | 258 | | |
| |||
311 | 302 | | |
312 | 303 | | |
313 | 304 | | |
314 | | - | |
| 305 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
0 commit comments