Skip to content

chore(deps): update rust crate sugar_path to v3 - #315

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/major-rust-crates
Open

chore(deps): update rust crate sugar_path to v3#315
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/major-rust-crates

Conversation

@renovate

@renovate renovate Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change
sugar_path dependencies major 2.0.13.0.0

Release Notes

hyf0/sugar_path (sugar_path)

v3.0.0

Compare Source

Breaking redesign of the public path APIs for borrowing, explicit cwd, and owned-buffer reuse (#​40). Public docs and continuous CI allocation gates were aligned with that surface (#​42). Performance baselines landed first as PR #​41.

Added
  • Add try_absolutize and try_relative for callers that handle ambient current-directory errors.
  • Add relative_with for relative calculation against an explicit externally managed cwd.
  • Add strict, fallible strict, and explicitly lossy slash conversion for borrowed paths and consuming PathBuf values.
  • Add consuming PathBuf normalization through the sealed SugarPathBuf extension trait.
Changed
  • Seal SugarPath as an extension-method namespace implemented directly for Path and str; owned standard types and string wrappers continue to use it through deref method lookup.
  • Change relative to return Cow<Path> directly, borrowing a canonical descendant suffix when possible; callers requiring PathBuf use Cow::into_owned.
  • Follow Node-style host-native normalization by preserving one trailing separator on non-root paths and preserving Windows drive-letter spelling while retaining case-insensitive drive comparison.
  • Keep relative output independent from normalization's trailing-separator preservation: equal paths return an empty path and target trailing separators are removed.
  • Change to_slash to the ergonomic strict conversion that panics for invalid Unicode, and move the non-replacing fallible contract to try_to_slash.
  • Change absolutize_with and relative_with to accept borrowed or owned cwd values directly without requiring callers to construct Cow; an owned PathBuf may transfer its allocation.
  • Preserve full non-UTF-8 Path and OsStr behavior for path operations; only conversion to Unicode chooses strict, fallible, or lossy policy.
Fixed
  • Preserve complete drive, UNC, verbatim UNC, and device roots when calculating Windows relative paths, including invalid-wide fallback inputs.
  • Preserve unresolved Windows drive-relative paths when an explicit cwd belongs to another drive instead of consulting ambient state or fabricating a rooted path.
  • Preserve literal / characters inside Windows verbatim components, keep or insert the minimal .\ needed to prevent a normal component from becoming a prefix during normalization, and return the normalized target when a component cannot be represented as a standalone native relative path.
Performance
  • Avoid current-directory access for inputs whose result is cwd-independent.
  • Avoid result allocation for canonical native descendant relative calls on Unix and Windows.
  • Reuse owned cwd, normalized PathBuf, and valid-Unicode slash-conversion buffers where possible.
  • Use separator-aware Windows comparisons, inline component storage, memchr, and target-specific common-prefix scanning for Rolldown-shaped paths.
Migration
  • Append .into_owned() to relative(base) only where the former owned PathBuf result is still required.
  • For known-UTF-8 owned text, replace relative(base).to_slash_lossy().into_owned() with relative(base).into_owned().into_slash(); otherwise select the strict fallible or explicitly lossy conversion that matches the caller's encoding policy.
  • Replace to_slash().unwrap() with to_slash() when valid UTF-8 is an invariant, and use try_to_slash() when invalid encoding is recoverable.
  • Pass cwd directly to absolutize_with and relative_with; do not wrap it in Cow::Borrowed or Cow::Owned.

Configuration

📅 Schedule: (in timezone Asia/Shanghai)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added the dependencies 依赖管理 label Jul 12, 2026
@renovate
renovate Bot force-pushed the renovate/major-rust-crates branch 3 times, most recently from 99295d1 to eb332c6 Compare July 18, 2026 01:32
@renovate
renovate Bot force-pushed the renovate/major-rust-crates branch 6 times, most recently from 36caad9 to 2802974 Compare July 26, 2026 09:47
@renovate
renovate Bot force-pushed the renovate/major-rust-crates branch 5 times, most recently from e26c4a5 to cf67b19 Compare August 2, 2026 13:20
@renovate
renovate Bot force-pushed the renovate/major-rust-crates branch 5 times, most recently from 9e80e9a to b731600 Compare August 9, 2026 09:44
@renovate
renovate Bot force-pushed the renovate/major-rust-crates branch 6 times, most recently from f4ccafd to a686bcc Compare August 18, 2026 18:52
@renovate
renovate Bot force-pushed the renovate/major-rust-crates branch 4 times, most recently from e8d4a7b to 775299e Compare August 23, 2026 05:57
@renovate
renovate Bot force-pushed the renovate/major-rust-crates branch 2 times, most recently from 9901349 to dd97c3c Compare August 26, 2026 23:51
@renovate
renovate Bot force-pushed the renovate/major-rust-crates branch from dd97c3c to e10b49b Compare August 28, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies 依赖管理

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants