Commit 2052ec1
committed
Merge #199: hrp: small improvement in hrp parsing
3322ca4 hrp: small improvement in hrp parsing (Thomas Coratger)
Pull request description:
In the HRP parsing function, we first test the following conditions with potential error outputs:
```rust
if hrp.is_empty() {
return Err(Empty);
}
if hrp.len() > MAX_HRP_LEN {
return Err(TooLong(hrp.len()));
}
```
So we don't need to directly declare the `new` variable in case an error is thrown and this declaration becoming useless. We can wait for the checks to be ok before declaring this (very small improvement).
ACKs for top commit:
tcharding:
ACK 3322ca4
apoelstra:
ACK 3322ca4 successfully ran local tests
clarkmoody:
ACK 3322ca4
Tree-SHA512: 92da994c5c504cf34e443646548a567076edb57fcbb88e08bada8d1e60ffaeaced50e5665b22dfded5c31107671d3ca7f49dc6eaaeb732a43ac424a3425fa1451 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
83 | 81 | | |
84 | 82 | | |
85 | 83 | | |
86 | 84 | | |
87 | 85 | | |
88 | 86 | | |
89 | 87 | | |
| 88 | + | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
0 commit comments