Skip to content

Commit f7d846e

Browse files
committed
Merge #215: chore: fix cargo clippy warning
9390a63 chore: fix cargo clippy warning (xixishidibei) Pull request description: Running cargo clippy reports the following error. ```shell warning: calling `as_bytes` after slicing a string --> src/primitives/decode.rs:138:30 | 138 | data_part_ascii: rest[1..].as_bytes(), // Skip the separator. | ^^^^^^^^^^^^^^^^^^^^ help: try: `&rest.as_bytes()[1..]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#sliced_string_as_bytes = note: `#[warn(clippy::sliced_string_as_bytes)]` on by default ``` This commit resolves the issue. ACKs for top commit: apoelstra: ACK 9390a63; successfully ran local tests clarkmoody: ACK 9390a63 Tree-SHA512: 28c237d5ea4587953aa4189604ce4fbf66491b5ba3115aba8011186b929c21795c69cfc76fcdf2ca4ccbbbef7e70103c46209b1d92f3161cb7145418468e7054
2 parents 6bfa241 + 9390a63 commit f7d846e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/primitives/decode.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl<'s> UncheckedHrpstring<'s> {
135135

136136
let ret = UncheckedHrpstring {
137137
hrp: Hrp::parse(hrp)?,
138-
data_part_ascii: rest[1..].as_bytes(), // Skip the separator.
138+
data_part_ascii: &rest.as_bytes()[1..], // Skip the separator.
139139
hrpstring_length: s.len(),
140140
};
141141

0 commit comments

Comments
 (0)