Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc improvements to CI, README, metadata, docs. #51

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 12 additions & 30 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -37,51 +37,33 @@ 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:
runs-on: ubuntu-latest
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
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ authors = ["Alex Crichton <[email protected]>",
"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.
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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**

Expand All @@ -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 <https://docs.rs/vec_map>.
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@ pub struct VecMap<V> {

/// 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<V>,
index: usize,
}

/// An occupied Entry.
/// An occupied `Entry`.
pub struct OccupiedEntry<'a, V> {
map: &'a mut VecMap<V>,
index: usize,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down