diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fa27d5b..5d22a00 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -13,7 +13,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build run: cargo build --verbose - name: Run tests @@ -25,7 +25,7 @@ jobs: name: "Miri" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Miri run: | rustup toolchain install nightly --component miri @@ -37,35 +37,23 @@ jobs: fmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master with: toolchain: stable - profile: minimal components: rustfmt - override: true - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - run: cargo fmt --all -- --check clippy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master with: toolchain: stable - profile: minimal components: clippy - override: true - - uses: actions-rs/clippy-check@v1 - env: - PWD: ${{ env.GITHUB_WORKSPACE }} - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --workspace --tests --examples + - run: cargo clippy --workspace --tests --examples docs: @@ -73,15 +61,9 @@ jobs: env: RUSTDOCFLAGS: -Dwarnings steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master with: toolchain: stable - profile: minimal - components: rust-docs - override: true - - uses: swatinem/rust-cache@v1 - - uses: actions-rs/cargo@v1 - with: - command: doc - args: --workspace --no-deps + - uses: swatinem/rust-cache@v2 + - run: cargo doc --workspace --no-deps diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 46f360c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: rust -sudo: false -matrix: - include: - - rust: stable - - rust: beta - - rust: nightly - - rust: nightly - env: FEATURES="--features eders" -script: - - cargo build $FEATURES - - cargo test $FEATURES - - cargo doc --no-deps -after_success: | - [ "$TRAVIS_RUST_VERSION" = nightly ] && - [ "$FEATURES" = "" ] && - [ "$TRAVIS_BRANCH" = master ] && - [ "$TRAVIS_PULL_REQUEST" = false ] && - bash deploy-docs.sh -notifications: - webhooks: http://huon.me:54857/travis diff --git a/Cargo.toml b/Cargo.toml index f09dafd..91048e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,14 +29,14 @@ authors = ["Alex Crichton ", "Vadim Petrochenkov <>"] edition = "2018" -license = "MIT/Apache-2.0" +license = "MIT OR Apache-2.0" description = "A simple map based on a vector for small integer keys" repository = "https://github.com/contain-rs/vec-map" homepage = "https://github.com/contain-rs/vec-map" documentation = "https://contain-rs.github.io/vec-map/vec_map" keywords = ["data-structures", "collections", "vecmap", "vec_map", "contain-rs"] readme = "README.md" -exclude = ["/.travis.yml", "/deploy-docs.sh"] +exclude = ["/deploy-docs.sh"] [features] # This feature is kept for backwards compatibility. Use feature "serde" instead. diff --git a/README.md b/README.md index 8b0d4b9..41103dd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -![Rust CI](https://github.com/contain-rs/vec-map/workflows/Rust/badge.svg?branch=master) [![crates.io](https://img.shields.io/crates/v/vec-map.svg)](https://crates.io/crates/vec-map) [![](https://docs.rs/vec-map/badge.svg)](https://docs.rs/vec-map) + +[![Rust](https://github.com/contain-rs/vec-map/actions/workflows/rust.yml/badge.svg)](https://github.com/contain-rs/vec-map/actions/workflows/rust.yml) +[![crates.io](https://img.shields.io/crates/v/vec_map.svg)](https://crates.io/crates/vec_map) +[![](https://docs.rs/vec_map/badge.svg)](https://docs.rs/vec_map) + **WARNING: THIS PROJECT IS IN MAINTENANCE MODE, DUE TO INSUFFICIENT MAINTAINER RESOURCES** @@ -14,4 +18,4 @@ We are currently only accepting changes which: A simple map based on a vector for small integer keys. -Documentation is available at https://contain-rs.github.io/vec-map/vec_map. +Documentation is available at . diff --git a/src/lib.rs b/src/lib.rs index 209ef7c..234379d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -71,20 +71,20 @@ pub struct VecMap { /// A view into a single entry in a map, which may either be vacant or occupied. pub enum Entry<'a, V> { - /// A vacant Entry + /// A vacant `Entry` Vacant(VacantEntry<'a, V>), - /// An occupied Entry + /// An occupied `Entry` Occupied(OccupiedEntry<'a, V>), } -/// A vacant Entry. +/// A vacant `Entry`. pub struct VacantEntry<'a, V> { map: &'a mut VecMap, index: usize, } -/// An occupied Entry. +/// An occupied `Entry`. pub struct OccupiedEntry<'a, V> { map: &'a mut VecMap, index: usize, @@ -673,7 +673,7 @@ impl<'a, V> Entry<'a, V> { } impl<'a, V> VacantEntry<'a, V> { - /// Sets the value of the entry with the VacantEntry's key, + /// Sets the value of the entry with the `VacantEntry`'s key, /// and returns a mutable reference to it. pub fn insert(self, value: V) -> &'a mut V { let index = self.index; @@ -701,7 +701,7 @@ impl<'a, V> OccupiedEntry<'a, V> { &mut self.map[index] } - /// Sets the value of the entry with the OccupiedEntry's key, + /// Sets the value of the entry with the `OccupiedEntry`'s key, /// and returns the entry's old value. pub fn insert(&mut self, value: V) -> V { let index = self.index;