Skip to content

Commit d7ddadd

Browse files
committed
chore: inline, remove limit
1 parent c296a10 commit d7ddadd

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

crates/tx-cache/src/client.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,7 @@ impl TxCache {
106106
.join(join)
107107
.inspect_err(|e| warn!(%e, "Failed to join URL. Not querying transaction cache."))?;
108108

109-
let request = if let Some(query) = query {
110-
self.client.get(url).query(&query.cursor().to_query_object())
111-
} else {
112-
self.client.get(url)
113-
};
109+
let request = self.client.get(url).query(&query.map(|q| q.to_query_object()));
114110

115111
// Get the result.
116112
request

crates/tx-cache/src/types.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -548,15 +548,12 @@ impl CursorKey for OrderKey {
548548
pub struct PaginationParams<C: CursorKey> {
549549
/// The cursor to start from.
550550
cursor: C,
551-
/// The number of items to return.
552-
#[serde(skip_serializing_if = "Option::is_none")]
553-
limit: Option<u32>,
554551
}
555552

556553
impl<C: CursorKey> PaginationParams<C> {
557554
/// Creates a new instance of [`PaginationParams`].
558-
pub const fn new(cursor: C, limit: Option<u32>) -> Self {
559-
Self { cursor, limit }
555+
pub const fn new(cursor: C) -> Self {
556+
Self { cursor }
560557
}
561558

562559
/// Get the cursor to start from.
@@ -568,16 +565,6 @@ impl<C: CursorKey> PaginationParams<C> {
568565
pub fn into_cursor(self) -> C {
569566
self.cursor
570567
}
571-
572-
/// Set the limit for the pagination params.
573-
pub fn with_limit(self, limit: u32) -> Self {
574-
Self { limit: Some(limit), cursor: self.cursor }
575-
}
576-
577-
/// Get the limit for the items returned.
578-
pub const fn limit(&self) -> Option<u32> {
579-
self.limit
580-
}
581568
}
582569

583570
impl<C: CursorKey> CursorKey for PaginationParams<C> {

0 commit comments

Comments
 (0)