diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b8933ec..445347f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,6 +33,11 @@ jobs: test: name: Test runs-on: ubuntu-latest + services: + mongo: + image: mongo + ports: + - 27017:27017 steps: - name: Checkout repository uses: actions/checkout@v4 @@ -46,9 +51,36 @@ jobs: run: cargo test --no-run - name: Test run: cargo hack test --feature-powerset + examples: + name: Examples + runs-on: ubuntu-latest + services: + mongo: + image: mongo + ports: + - 27017:27017 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - uses: Swatinem/rust-cache@v2 + - name: Run example default + run: cargo run --example default --verbose + - name: Run example multisort + run: cargo run --example multisort --verbose + - name: Run example regex + run: cargo run --example regex --verbose msrv: name: "Check MSRV" runs-on: ubuntu-latest + services: + mongo: + image: mongo + ports: + - 27017:27017 steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index ddaac9b..0000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Rust - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -env: - CARGO_TERM_COLOR: always - -jobs: - build: - - runs-on: ubuntu-latest - - services: - mongo: - image: mongo - ports: - - 27017:27017 - - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - name: Build - run: cargo build --release --verbose - - name: Run tests - run: cargo test --verbose - - name: Run example default - run: cargo run --example default --verbose - - name: Run example multisort - run: cargo run --example multisort --verbose - - name: Run example regex - run: cargo run --example regex --verbose diff --git a/committed.toml b/committed.toml new file mode 100644 index 0000000..7ce6d58 --- /dev/null +++ b/committed.toml @@ -0,0 +1,4 @@ +style = "conventional" +ignore_author_re = "(dependabot|renovate)" +merge_commit = false +subject_length = 72 diff --git a/src/lib.rs b/src/lib.rs index 37ec1f5..c4737aa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,9 +3,9 @@ //! ### Usage: //! The usage is a bit different than the node version. See the examples for more details and a working example. //! ```rust +//! use bson::doc; //! use mongodb::{options::FindOptions, Client}; //! use mongodb_cursor_pagination::{FindResult, Pagination}; -//! use bson::doc; //! use serde::Deserialize; //! //! // Note that your data structure must derive Deserialize @@ -51,9 +51,9 @@ //! //! // query page 1, 2 at a time //! let options = FindOptions::builder() -//! .limit(2) -//! .sort(doc! { "name": 1 }) -//! .build(); +//! .limit(2) +//! .sort(doc! { "name": 1 }) +//! .build(); //! //! let mut find_results: FindResult = fruits //! .find_paginated(None, Some(options.clone()), None) @@ -86,7 +86,7 @@ //! pub has_next_page: bool, //! pub has_previous_page: bool, //! pub start_cursor: Option, -//! pub next_cursor: Option, +//! pub end_cursor: Option, //! } //! //! pub struct Edge { diff --git a/src/model.rs b/src/model.rs index fc49b77..4861ef9 100644 --- a/src/model.rs +++ b/src/model.rs @@ -88,6 +88,7 @@ impl<'de> Deserialize<'de> for Edge { #[cfg(feature = "graphql")] #[juniper::graphql_object] +#[allow(clippy::multiple_inherent_impl)] impl Edge { fn cursor(&self) -> String { self.0.to_string()