diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml new file mode 100644 index 00000000..91433ef7 --- /dev/null +++ b/.github/workflows/clippy.yml @@ -0,0 +1,35 @@ +name: Clippy + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + +env: + CARGO_TERM_COLOR: always + +jobs: + clippy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Install Clippy + run: + rustup toolchain install nightly --component clippy + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + - name: Run clippy + run: cargo clippy --all-features + - name: Run clippy without rayon + run: cargo clippy --no-default-features --features="serde" + - name: Run tests + run: cargo test --all-features + - name: Run tests without rayon + run: cargo test --no-default-features --features="serde" + - name: Run tests release + run: cargo test --release --all-features \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 64afdc10..dafb94d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [v0.3.1] +- Added derives across all data structures, including: + - `Clone` + - `Debug` + - serde's `Serialize` & `Deserialize`, available under the feature `serde`. + - [mem-dbg](https://github.com/zommiommy/mem_dbg-rs)'s `MemDbg` & `MemSize`, available under the feature `mem-dbg`. +- Moved rayon, which is optionally used in dependency crates, under the feature `rayon`. +- Switched from Travis-CI to GitHub Actions. +- Fixed several code smells as reported by clippy. +- Extended documentation & doctests. + ## [v0.3.0] - Use iterators for search results. diff --git a/Cargo.toml b/Cargo.toml index 3d0ba1dd..d5e2c9d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "trie-rs" -version = "0.3.0" +version = "0.3.1" authors = ["Sho Nakatani ", "Shane Celis "] description = "Memory efficient trie (prefix tree) and map library based on LOUDS" readme = "README.md" @@ -9,10 +9,12 @@ repository = "https://github.com/laysakura/trie-rs" homepage = "https://github.com/laysakura/trie-rs" keywords = ["trie", "louds", "succinct"] # up to 5 keywords, each keyword should have <= 20 chars categories = ["compression", "data-structures"] -edition = "2018" +edition = "2021" [dependencies] louds-rs = "0.6" +mem_dbg = { version = "0.1.4", optional = true } +serde = { version = "1.0", features = ["derive"], optional = true } [dev-dependencies] criterion = "0.2" @@ -23,3 +25,8 @@ version-sync = "0.9" [[bench]] name = "bench" harness = false + +[features] +serde = ["louds-rs/serde", "dep:serde"] +mem_dbg = ["louds-rs/mem_dbg", "dep:mem_dbg"] +rayon = ["louds-rs/rayon"] \ No newline at end of file diff --git a/README.md b/README.md index 8bfb6efe..1393b1fa 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ Memory efficient trie (prefix tree) and map library based on LOUDS. | [Changelog](https://github.com/laysakura/trie-rs/blob/master/CHANGELOG.md) -[![Build Status](https://travis-ci.com/laysakura/trie-rs.svg?branch=master)](https://travis-ci.com/laysakura/trie-rs) +[![GitHub Actions Status](https://github.com/laysakura/trie-rs/actions/workflows/clippy.yml/badge.svg)](https://github.com/laysakura/trie-rs/actions) +[![Travis Status](https://travis-ci.com/laysakura/trie-rs.svg?branch=master)](https://travis-ci.com/laysakura/trie-rs) [![Crates.io Version](https://img.shields.io/crates/v/trie-rs.svg)](https://crates.io/crates/trie-rs) [![Crates.io Downloads](https://img.shields.io/crates/d/trie-rs.svg)](https://crates.io/crates/trie-rs) [![Minimum rustc version](https://img.shields.io/badge/rustc-1.33+-lightgray.svg)](https://github.com/laysakura/trie-rs#rust-version-supports) @@ -78,7 +79,7 @@ assert_eq!( ### Using with Various Data Types `TrieBuilder` is implemented using generic type like following: -```rust +```ignore impl TrieBuilder