Skip to content

Commit

Permalink
fix: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed May 18, 2023
1 parent ccf747e commit ba6d4da
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 24 deletions.
11 changes: 5 additions & 6 deletions src/api/client/crypto_wallet_tx_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ impl CryptoWalletTxResponse {
pub fn next_page(&self) -> Option<usize> {
if let Some(next) = &self.links.next {
let rgx = regex!(r"page=([0-9]+)");
rgx.captures(next)
.and_then(|captures| {
captures
.get(1)
.map(|capture| capture.as_str().parse().unwrap())
})
rgx.captures(next).and_then(|captures| {
captures
.get(1)
.map(|capture| capture.as_str().parse().unwrap())
})
} else {
None
}
Expand Down
11 changes: 5 additions & 6 deletions src/api/client/fiat_wallet_tx_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ impl FiatWalletTxResponse {
pub fn next_page(&self) -> Option<usize> {
if let Some(next) = &self.links.next {
let rgx = regex!(r"page=([0-9]+)");
rgx.captures(next)
.and_then(|captures| {
captures
.get(1)
.map(|capture| capture.as_str().parse().unwrap())
})
rgx.captures(next).and_then(|captures| {
captures
.get(1)
.map(|capture| capture.as_str().parse().unwrap())
})
} else {
None
}
Expand Down
11 changes: 5 additions & 6 deletions src/api/client/get_assets_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ impl GetAssetsResponse {
pub fn next_page(&self) -> Option<usize> {
if let Some(next) = &self.links.next {
let rgx = regex!(r"page=([0-9]+)");
rgx.captures(next)
.and_then(|captures| {
captures
.get(1)
.map(|capture| capture.as_str().parse().unwrap())
})
rgx.captures(next).and_then(|captures| {
captures
.get(1)
.map(|capture| capture.as_str().parse().unwrap())
})
} else {
None
}
Expand Down
11 changes: 5 additions & 6 deletions src/api/client/trade_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ impl TradeResponse {
pub fn next_page(&self) -> Option<usize> {
if let Some(next) = &self.links.next {
let rgx = regex!(r"page=([0-9]+)");
rgx.captures(next)
.and_then(|captures| {
captures
.get(1)
.map(|capture| capture.as_str().parse().unwrap())
})
rgx.captures(next).and_then(|captures| {
captures
.get(1)
.map(|capture| capture.as_str().parse().unwrap())
})
} else {
None
}
Expand Down

0 comments on commit ba6d4da

Please sign in to comment.