audio_samples 1.0.13

A typed audio processing library for Rust that treats audio as a first-class, invariant-preserving object rather than an unstructured numeric buffer.
Documentation
# Simplification report: Cargo.toml

**Verified against:** default features (S1–S4 checked under `--features full` for S1, default for S2–S4), toolchain `nightly` (from `rust-toolchain.toml`)
**Baseline:** 1 warning group → with all accepted changes: unchanged (0 regressions)
**Working tree:** restored, unchanged

## Summary

A mature library Cargo.toml with a well-structured feature graph. Two issues stand out: `full` and `full_no_plotting` maintain identical 19-item member lists in parallel, creating a drift risk; and three places list features that are already transitively implied. One dead optional dependency (`num-format`) has no source references and no feature entry.

---

## Suggestions

### S1 — Express `full` in terms of `full_no_plotting`  ·  feature-dedup  ·  safe  ·  ✅ verified

**Location:** `Cargo.toml:106–128`

**Why:** `full` is `full_no_plotting` plus `plotting` and `parallel`. Keeping two separate 19-item lists is a drift trap — a feature added to one must be manually mirrored in the other. One line eliminates the duplication and makes the relationship explicit.

```toml
# before
full = [
    "statistics",
    "editing",
    "transforms",
    "channels",
    "resampling",
    "fixed-size-audio",
    "beat-tracking",
    "onset-detection",
    "decomposition",
    "dynamic-range",
    "parametric-eq",
    "peak-picking",
    "pitch-analysis",
    "processing",
    "vad",
    "iir-filtering",
    "plotting",
    "envelopes",
    "random-generation",
    "psychoacoustic",
    "parallel",
]
```

```toml
# after
full = ["full_no_plotting", "plotting"]
```

---

### S2 — Remove redundant `random-generation` from `envelopes`  ·  transitive-feature  ·  safe  ·  ✅ verified

**Location:** `Cargo.toml:97–102`

**Why:** `editing = ["statistics", "random-generation"]`. Since `envelopes` already lists `editing`, the `random-generation` entry is redundant — Cargo will activate it via `editing` regardless.

```toml
# before
envelopes = [
    "dynamic-range",
    "editing",
    "random-generation",
    "dep:rustfft"
]
```

```toml
# after
envelopes = [
    "dynamic-range",
    "editing",
    "dep:rustfft"
]
```

---

### S3 — Remove redundant `statistics` from `plotting`  ·  transitive-feature  ·  safe  ·  ✅ verified

**Location:** `Cargo.toml:96`

**Why:** `editing = ["statistics", "random-generation"]`. Since `plotting` already lists `editing`, listing `statistics` explicitly is redundant.

```toml
# before
plotting = ["dep:plotly", "dep:base64", "dep:serde_json", "channels", "transforms", "statistics", "editing"]
```

```toml
# after
plotting = ["dep:plotly", "dep:base64", "dep:serde_json", "channels", "transforms", "editing"]
```

---

### S4 — Remove dead `num-format` optional dependency  ·  dead-dep  ·  safe  ·  ✅ verified

**Location:** `Cargo.toml:38`

**Why:** `num-format` is `optional = true`, is not activated by any `[features]` entry, and has no `use num_format::` or `num-format` references anywhere in `src/`, `examples/`, `benches/`, or `tests/`. Confirmed by grep. Removing it eliminates a crates.io download and a stale entry. Verified by deletion + `cargo check --features full` — no compile errors.

```toml
# before
num-format = { version = "0.4.4", optional = true }
```

```toml
# after
# (line removed)
```

---

## Flagged — review before publishing

### F1 — `[patch.crates-io]` self-patch  ·  🚩 flag

**Location:** `Cargo.toml:215–216`

```toml
[patch.crates-io]
audio_samples = { path = "." }
```

This patches the crate to itself. It's a common local-dev pattern that ensures internal doctests or examples that `use audio_samples` resolve to the workspace version rather than crates.io. However, it affects the resolver for anyone who depends on this crate and it reads oddly in a published Cargo.toml. The `cargo-toml.md` reference calls for an explicit ask before removing it. **Recommend confirming this is intentional** before shipping — if it's only needed for local dev, consider moving it to a workspace-level `Cargo.toml` or a local `.cargo/config.toml` patch instead.

---

## Not changed (considered, rejected)

- **`audioadapter` vs `dep:audioadapter` in `resampling`** — The `resampling` feature uses `"audioadapter"` and `"audioadapter-buffers"` without `dep:` prefix, relying on the implicit feature aliases. Switching to `dep:audioadapter` would suppress those implicit aliases (removing `audioadapter` as a public feature name). Since this changes the crate's visible feature surface, it is treated as a soft breaking-API concern and skipped.
- **Redundant items in `full_no_plotting`** — Many of its 19 entries are transitively implied by others in the list (e.g., `onset-detection` implies `transforms`, `peak-picking`, `processing`; `editing` implies `statistics`, `random-generation`). The list could shrink significantly. However, explicit membership in an aggregate feature is often intentional for documentation purposes, and once S1 is applied, fixing `full_no_plotting` also fixes `full`. Left for a follow-up pass if desired.
- **`[lib]` section** — `name = "audio_samples"` and `crate-type = ["rlib"]` are both Cargo defaults for a library package with a matching name. They could be dropped entirely, but this is purely cosmetic and not worth the noise.
- **`fixed-size-audio = []`** — Empty feature, same pattern as `bare-bones`, `vad`, `statistics`, etc. Intentional feature gates; do not remove.