Skip to content

Commit 9482ec1

Browse files
committed
Amend
1 parent 3d8554b commit 9482ec1

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/index.rs

+11-10
Original file line numberDiff line numberDiff line change
@@ -2281,18 +2281,19 @@ impl Index {
22812281

22822282
inscriptions.sort_by_key(|(sequence_number, _)| *sequence_number);
22832283

2284-
let mut result = Vec::new();
2285-
for (sequence_number, offset) in inscriptions.into_iter() {
2286-
let entry = sequence_number_to_inscription_entry
2287-
.get(sequence_number)?
2288-
.unwrap();
2289-
2290-
let satpoint = SatPoint { outpoint, offset };
2284+
inscriptions
2285+
.into_iter()
2286+
.map(|(sequence_number, offset)| {
2287+
let entry = sequence_number_to_inscription_entry
2288+
.get(sequence_number)?
2289+
.unwrap();
22912290

2292-
result.push((satpoint, InscriptionEntry::load(entry.value()).id))
2293-
}
2291+
let satpoint = SatPoint { outpoint, offset };
22942292

2295-
Ok(Some(result))
2293+
Ok((satpoint, InscriptionEntry::load(entry.value()).id))
2294+
})
2295+
.collect::<Result<_>>()
2296+
.map(Some)
22962297
}
22972298

22982299
pub fn get_address_info(&self, address: &Address) -> Result<Vec<OutPoint>> {

0 commit comments

Comments
 (0)