diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3894efc..f6f7e64 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,12 @@ name: build -on: [ push, pull_request ] +on: + push: + branches: + - main + pull_request: + branches: + - main jobs: fmt: @@ -16,17 +22,20 @@ jobs: - uses: actions/checkout@v3 - run: rustup update && rustup component add clippy - uses: Swatinem/rust-cache@v2 - - run: cargo clippy --all-targets - - run: cargo clippy --all-targets --all-features + - run: cargo clippy --all-targets -- -D warnings -D clippy::all + - run: cargo clippy --all-targets --all-features -- -D warnings -D clippy::all + - run: cargo clippy --all-targets --no-default-features -- -D warnings -D clippy::all clippy_msrv: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - run: rustup update && rustup override set 1.58.0 && rustup component add clippy + - run: rustup update && rustup override set 1.63.0 && rustup component add clippy && rustup toolchain install nightly - uses: Swatinem/rust-cache@v2 - - run: cargo clippy --all-targets -- -D warnings -D clippy::all - - run: cargo clippy --all-targets --all-features -- -D warnings -D clippy::all + - run: cargo +nightly update -Z direct-minimal-versions + - run: cargo clippy -- -D warnings -D clippy::all + - run: cargo clippy --all-features -- -D warnings -D clippy::all + - run: cargo clippy --no-default-features -- -D warnings -D clippy::all test: runs-on: ubuntu-latest @@ -35,10 +44,9 @@ jobs: - run: rustup update - uses: Swatinem/rust-cache@v2 - run: cargo build --all-features - - run: cargo test --verbose - - run: cargo test --verbose --all-features - env: - RUST_BACKTRACE: 1 + - run: cargo test + - run: cargo test --all-features + - run: cargo test --no-default-features rustdoc: runs-on: ubuntu-latest @@ -47,14 +55,6 @@ jobs: - run: rustup update - uses: Swatinem/rust-cache@v2 - run: cargo doc --all-features --no-deps - - rustdoc_msrv: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - run: rustup update && rustup override set 1.58.0 - - uses: Swatinem/rust-cache@v2 - - run: cargo doc --all-features --no-deps env: RUSTDOCFLAGS: -D warnings diff --git a/Cargo.toml b/Cargo.toml index f566ab9..320d04f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ description = """ Simple and fast implementation of language tag normalization and validation """ edition = "2018" -rust-version = "1.58" +rust-version = "1.63" [features] default = ["std"] @@ -22,10 +22,10 @@ alloc = ["serde?/alloc"] serialize = ["dep:serde"] [dependencies] -serde = { version = "1", optional = true, default_features = false } +serde = { version = "1.0.100", optional = true, default_features = false } [dev-dependencies] -criterion = "0.4" +criterion = ">=0.4,<0.6" serde_test = "1" [[bench]] diff --git a/README.md b/README.md index 933e8e0..40f72c7 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,11 @@ assert_eq!(language_tag.extension(), None); assert_eq!(language_tag.private_use_subtags().collect::>(), vec!["test"]); ``` +It is also possible to use this crate in `no_std` (with `alloc`) by opting-out of the default `std` feature: +```toml +serde = { version = "*", default-features = false } +``` + ## License This project is licensed under the MIT license ([LICENSE-MIT](LICENSE-MIT) or ``).