Skip to content

Commit bedef8f

Browse files
committed
chore: remove irrefutable if let
This causes a warning in the latest versions of Rust.
1 parent c773444 commit bedef8f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

stackslib/src/net/api/getattachmentsinv.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,13 @@ impl HttpRequest for RPCGetAttachmentsInvRequestHandler {
9696
if key == "index_block_hash" {
9797
index_block_hash = StacksBlockId::from_hex(&value).ok();
9898
} else if key == "pages_indexes" {
99-
if let Ok(pages_indexes_value) = value.parse::<String>() {
100-
for entry in pages_indexes_value.split(',') {
101-
if let Ok(page_index) = entry.parse::<u32>() {
102-
page_indexes.insert(page_index);
103-
}
99+
#[allow(clippy::expect_used)]
100+
let pages_indexes_value = value
101+
.parse::<String>()
102+
.expect("parse from Cow<str> is always safe");
103+
for entry in pages_indexes_value.split(',') {
104+
if let Ok(page_index) = entry.parse::<u32>() {
105+
page_indexes.insert(page_index);
104106
}
105107
}
106108
}

0 commit comments

Comments
 (0)