Skip to content

Commit

Permalink
feat: replace ritelinked with hashlink (#327)
Browse files Browse the repository at this point in the history
* fix: replace ritelinked with hashlink

* fix: update github workflow to remove amortized

* chore: apply cargo fmt
  • Loading branch information
ChosunOne authored Feb 6, 2024
1 parent 4884cd2 commit 22eb692
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 30 deletions.
28 changes: 6 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: CI

on:
pull_request:
push:
branches:
- master

jobs:
build:
name: Auto Build CI
Expand All @@ -14,88 +12,74 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [beta, stable]

steps:
- name: Checkout Repository
uses: actions/checkout@master

- name: Install Rust toolchain ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
override: true

- name: Install wasm32-unknown-unknown for ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
toolchain: ${{ matrix.rust }}
target: wasm32-unknown-unknown
override: true

# Work around https://github.com/actions/cache/issues/403 by using GNU tar
# instead of BSD tar.
- name: Install GNU tar
if: matrix.os == 'macOS-latest'
run: |
brew install gnu-tar
echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-${{ secrets.CACHE_VERSION }}

- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-${{ secrets.CACHE_VERSION }}

- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}-${{ secrets.CACHE_VERSION }}

- name: Release build async-std
uses: actions-rs/cargo@v1
with:
command: build
args: --release --no-default-features --features runtime-async-std,cached,glob,ip,watcher,logging,incremental,explain

- name: Release build tokio
uses: actions-rs/cargo@v1
with:
command: build
args: --release --no-default-features --features runtime-tokio,cached,glob,ip,watcher,logging,incremental,explain

- name: Cargo Test For All Features Using async-std
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --features runtime-async-std,amortized,cached,glob,ip,watcher,logging,incremental,explain

args: --no-default-features --features runtime-async-std,cached,glob,ip,watcher,logging,incremental,explain
- name: Cargo Test For All Features Using tokio
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --features runtime-tokio,amortized,cached,glob,ip,watcher,logging,incremental,explain

args: --no-default-features --features runtime-tokio,cached,glob,ip,watcher,logging,incremental,explain
- name: Cargo Check Wasm
uses: actions-rs/cargo@v1
with:
command: check
args: --target wasm32-unknown-unknown --no-default-features --features runtime-async-std,amortized,cached,glob,ip,watcher,logging,incremental

command: check
args: --target wasm32-unknown-unknown --no-default-features --features runtime-async-std,cached,glob,ip,watcher,logging,incremental
- name: Clippy warnings
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

- name: Cargo Fmt Check
uses: actions-rs/cargo@v1
with:
Expand Down
6 changes: 1 addition & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ async-std = { version = "1.10.0", optional = true }

async-trait = "0.1.52"
globset = { version = "0.4.8", optional = true }
ritelinked = { version = "0.3.2", default-features = false, features = [
"ahash",
"inline-more",
] }
hashlink = "0.9.0"
ip_network = { version = "0.4.1", optional = true }
once_cell = "1.9.0"
mini-moka = { version = "0.10", optional = true }
Expand Down Expand Up @@ -51,7 +48,6 @@ tokio-stream = { version = "0.1.8", optional = true, default-features = false }
[features]
default = ["runtime-tokio", "incremental"]

amortized = ["ritelinked/ahash-amortized", "ritelinked/inline-more-amortized"]
cached = ["mini-moka"]
explain = []
glob = ["globset"]
Expand Down
2 changes: 1 addition & 1 deletion src/adapter/memory_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
};

use async_trait::async_trait;
use ritelinked::LinkedHashSet;
use hashlink::LinkedHashSet;

#[derive(Default)]
pub struct MemoryAdapter {
Expand Down
2 changes: 1 addition & 1 deletion src/model/assertion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use crate::{
#[cfg(feature = "incremental")]
use crate::emitter::EventData;

use hashlink::{LinkedHashMap, LinkedHashSet};
use parking_lot::RwLock;
use ritelinked::{LinkedHashMap, LinkedHashSet};

use std::sync::Arc;

Expand Down
2 changes: 1 addition & 1 deletion src/model/default_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use crate::{
#[cfg(feature = "incremental")]
use crate::emitter::EventData;

use hashlink::{LinkedHashMap, LinkedHashSet};
use parking_lot::RwLock;
use ritelinked::{LinkedHashMap, LinkedHashSet};

#[cfg(all(feature = "runtime-async-std", not(target_arch = "wasm32")))]
use async_std::path::Path as ioPath;
Expand Down

0 comments on commit 22eb692

Please sign in to comment.