Skip to content

Commit

Permalink
Fix .clone()
Browse files Browse the repository at this point in the history
  • Loading branch information
arik-so committed Mar 20, 2024
1 parent 5c96e53 commit 5d399ca
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/subcommand/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1343,11 +1343,10 @@ impl Server {

// return the first inscription where the delegate exists
// probably worth considering some sort of limitation to mitigate "DoSability"
let inscription_override = inscription.delegates().iter().find_map(|delegate| {
index
.get_inscription_by_id(delegate.clone())
.unwrap_or(None)
});
let inscription_override = inscription
.delegates()
.iter()
.find_map(|delegate| index.get_inscription_by_id(*delegate).unwrap_or(None));

inscription = inscription_override.unwrap_or(inscription);

Expand Down Expand Up @@ -1445,11 +1444,10 @@ impl Server {
.get_inscription_by_id(inscription_id)?
.ok_or_not_found(|| format!("inscription {inscription_id}"))?;

let inscription_override = inscription.delegates().iter().find_map(|delegate| {
index
.get_inscription_by_id(delegate.clone())
.unwrap_or(None)
});
let inscription_override = inscription
.delegates()
.iter()
.find_map(|delegate| index.get_inscription_by_id(*delegate).unwrap_or(None));

inscription = inscription_override.unwrap_or(inscription);

Expand Down

0 comments on commit 5d399ca

Please sign in to comment.