docs: redesign public API guidance and slim CI allocation gates#42
Conversation
Fill remaining method examples and try/lossy contracts, polish the README for crates.io/docs.rs readers, and declare package docs metadata.
Merging this PR will improve performance by 12.87%
Performance Changes
Tip Curious why this is faster? Comment Comparing Footnotes
|
Restrict push triggers to main (match CodSpeed), cancel in-progress runs for the same PR, and run host-independent fmt/doc once on Ubuntu.
There was a problem hiding this comment.
Pull request overview
This PR refreshes the public-facing documentation and method contracts for the upcoming 3.0 API surface, positioning the crate as a small, task-oriented path utility with clear semantics, platform notes, and ownership/Unicode guarantees.
Changes:
- Reworked README and crate-level docs to guide users by task (normalize/absolutize/relative/slash conversion) and to clarify lexical vs filesystem semantics, ownership, and platform behavior.
- Expanded rustdoc for the
SugarPath/SugarPathBuftraits with stronger contracts and more examples (including ambient/try/explicit-cwd APIs and slash-policy APIs). - Strengthened documentation quality gates and metadata (CI
cargo docwith-D warnings, docs.rs all-features, package metadata).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/sugar_path.rs | Expanded SugarPath rustdoc contracts and added targeted examples (normalize/absolutize/relative/slash APIs). |
| src/sugar_path_buf.rs | Added examples and clarified error/Unicode and reuse semantics for consuming PathBuf APIs. |
| src/lib.rs | Redesigned crate-level rustdoc as a task-oriented landing page and enabled rustdoc link linting. |
| README.md | Restructured documentation for installation, API selection, semantics, platform support, and 2.x→3.x upgrade guidance. |
| CHANGELOG.md | Adjusted 2.0.0 compare link base and removed an outdated “pending integration” note. |
| Cargo.toml | Improved package metadata (docs/readme/categories), docs.rs all-features, and clarified feature comments. |
| AGENTS.md | Documented the local doc-build command mirroring CI’s “deny rustdoc warnings” behavior. |
| .github/workflows/test.yaml | Added a CI documentation step running cargo doc with RUSTDOCFLAGS=-D warnings. |
| .agents/docs/architecture.md | Updated architectural docs to reflect README/lib.rs as the primary user entry points and contracts location. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Drop macOS and default-feature committed snapshots. Continuous CI checks the two primary-consumer Rolldown snaps only, and docs/PCR stay in sync.
Always measure cached_current_dir in the tracker, drop allocs-rolldown, and rename the committed snaps to plain target triples.
Align architecture notes with try_get_current_dir after the ambient cwd API returned Result.
Inline the fixed cached_current_dir configuration label into the format string so CI clippy -D warnings passes again.
Summary
Polish the unreleased 3.0 public docs so the crate reads like a small professional path library, and slim the continuous CI / allocation gate so PR pushes stop double-running and only the useful snapshots are checked.
Documentation
src/lib.rscrate docs with that entry pathAGENTS.mdarchitecture note: ambient cwd helper istry_get_current_dir(), notget_current_dir()documentation,readme, docs.rs all-features) and clearer feature commentsCI and allocation gates
pushis limited tomain; PRs usepull_requestonlyfmt/rustdoconce on Ubuntux86_64-unknown-linux-gnu.snap,x86_64-pc-windows-msvc.snap)cargo allocsthe single entry point; the tracker always measurescached_current_dir(dropallocs-rolldownand dual default/Rolldown committed snaps)cargo docwithRUSTDOCFLAGS=-D warningsNotes
Cargo.tomlversion remains2.0.1on purpose; the version / lockfile / release changelog bump belongs to the release flow after this lands. The README states thatmaindocuments the upcoming 3.0 API and points at 2.0.1 docs for the published surface.mainuntil 3.0 rustdoc is published on docs.rs.Test plan
RUSTDOCFLAGS="-D warnings" cargo doc --locked --workspace --all-features --no-depscargo test --locked --doccargo test --locked --workspacecargo clippy --locked --workspace --all-targets --all-features -- -D warningscargo fmt --all --check