File tree Expand file tree Collapse file tree 2 files changed +3
-20
lines changed Expand file tree Collapse file tree 2 files changed +3
-20
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -548,15 +548,12 @@ impl CursorKey for OrderKey {
548548pub 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
556553impl < 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
583570impl < C : CursorKey > CursorKey for PaginationParams < C > {
You can’t perform that action at this time.
0 commit comments