Skip to content

Commit

Permalink
return slice from AuctionResults methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tbro committed Jul 23, 2024
1 parent 295ecfa commit aa2b71f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions types/src/v0/impls/auction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,20 +230,20 @@ impl BidTx {
}

impl AuctionResults {
pub fn winning_bids(&self) -> Vec<BidTx> {
self.winning_bids.clone()
pub fn winning_bids(&self) -> &[BidTx] {
&self.winning_bids
}
pub fn reserve_bids(&self) -> Vec<(NamespaceId, Url)> {
self.reserve_bids.clone()
pub fn reserve_bids(&self) -> &[(NamespaceId, Url)] {
&self.reserve_bids
}
}

impl HasUrls for AuctionResults {
fn urls(&self) -> Vec<Url> {
self.winning_bids
self.winning_bids()
.iter()
.map(|bid| bid.url())
.chain(self.reserve_bids.iter().map(|bid| bid.1.clone()))
.chain(self.reserve_bids().iter().map(|bid| bid.1.clone()))
.collect()
}
}
Expand Down

0 comments on commit aa2b71f

Please sign in to comment.