smart-string 0.3.0

A collection of string types and traits designed for enhanced string manipulation.
Documentation
name: ci

on:
  push:
  pull_request:

jobs:
  policy:
    name: policy (no Cargo.lock)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Fail if Cargo.lock is committed
        run: |
          set -euo pipefail
          if git ls-files | grep -Eq '(^|/)Cargo\.lock$'; then
            echo "error: Cargo.lock must not be committed in library repositories (it should be gitignored)." >&2
            exit 1
          fi

  fmt:
    name: fmt
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@nightly
        with:
          components: rustfmt
      - name: cargo fmt (check)
        run: cargo +nightly fmt --all -- --check

  test:
    name: check / test / clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - name: cargo check
        run: cargo check --all-targets
      - name: cargo test
        run: cargo test
      - name: cargo clippy
        run: cargo clippy --all-targets -- -D warnings
      - name: cargo doc (warn = error)
        run: cargo doc --no-deps
        env:
          RUSTDOCFLAGS: -D warnings

  miri:
    name: miri (UB detection)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@nightly
        with:
          components: miri
      - name: cargo miri test
        run: cargo +nightly miri test
        env:
          # strict-provenance: catch pointer provenance issues
          # ignore-leaks: SmartString::leak() intentionally leaks memory
          MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-ignore-leaks

  msrv:
    name: msrv (rustc 1.59.0)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@1.59.0
      # Use cargo from the 1.59.0 toolchain directly to avoid
      # "unknown print request split-debuginfo" errors that occur when
      # a newer stable cargo queries an older MSRV rustc.
      # --lib only: dev-dependencies (serde_json → ryu) may have higher
      # MSRV than the crate itself; we guarantee our lib compiles, not theirs.
      - name: cargo check (MSRV)
        run: cargo +1.59.0 check --lib