Skip to content

Commit

Permalink
Address nits and use de-facto Default derive
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-mysten committed Oct 21, 2024
1 parent 5703b4d commit 1ad2d24
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions crates/sui-graphql-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,29 +122,22 @@ impl<T> Page<T> {
}

/// Pagination direction.
#[derive(Default)]
pub enum Direction {
#[default]
Forward,
Backward,
}

/// Pagination options for querying the GraphQL server. It defaults to forward pagination with the
/// GraphQL server's default items per page limit.
#[derive(Default)]
pub struct PaginationFilter<'a> {
direction: Direction,
cursor: Option<&'a str>,
limit: Option<i32>,
}

impl Default for PaginationFilter<'_> {
fn default() -> Self {
Self {
direction: Direction::Forward,
cursor: None,
limit: None,
}
}
}

/// The GraphQL client for interacting with the Sui blockchain.
/// By default, it uses the `reqwest` crate as the HTTP client.
pub struct Client {
Expand Down

0 comments on commit 1ad2d24

Please sign in to comment.