Commit 03c0329
committed
Merge rust-bitcoin#4662: primitives: Inline
d42d478 primitives: Inline impl_to_hex_from_lower_hex and deprecate (Tobin C. Harding)
Pull request description:
Macros are basically just a pain in the arse. This one is used to reduced code duplication/verbosity even thought the function can be written as a one-liner.
Also calling macros across crate boundries is error prone and a constant source of maintenance grief.
Note also:
- The generated docs are quite general
- `#[inline]` is missing
- The docs on the macro are wrong in regards to the no-op
Remove all calls to the macro from `primitives` and inline using terse syntax by way of the `format!` macro.
Add `deprecated` attribute and direct users to just use `format!("{var:x}")` instead.
ACKs for top commit:
apoelstra:
ACK d42d478; successfully ran local tests
Tree-SHA512: 2029bb18d8d7b83f49da4e947b5feea6e92dcfa73e26439e1b8be278becce553006769280bfb51290fb50af3e28996dc06290aa670283666cae6fc6fec71b10eimpl_to_hex_from_lower_hex macro and deprecateFile tree
5 files changed
+39
-17
lines changed- primitives/src
- script
5 files changed
+39
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
140 | 152 | | |
141 | 153 | | |
142 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | 439 | | |
443 | 440 | | |
444 | 441 | | |
445 | 442 | | |
446 | 443 | | |
447 | 444 | | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | 445 | | |
452 | 446 | | |
453 | 447 | | |
| |||
942 | 936 | | |
943 | 937 | | |
944 | 938 | | |
945 | | - | |
| 939 | + | |
946 | 940 | | |
947 | 941 | | |
948 | 942 | | |
| |||
951 | 945 | | |
952 | 946 | | |
953 | 947 | | |
954 | | - | |
| 948 | + | |
955 | 949 | | |
956 | 950 | | |
957 | 951 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
114 | 126 | | |
115 | 127 | | |
116 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
181 | 187 | | |
182 | 188 | | |
183 | 189 | | |
| |||
223 | 229 | | |
224 | 230 | | |
225 | 231 | | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | 232 | | |
231 | 233 | | |
232 | 234 | | |
| |||
0 commit comments