Skip to content

Provide safe helper on PathGuard to hide unsafe Env::set_var API from consumers #111

@coderabbitai

Description

@coderabbitai

Description

The unsafe Env::set_var API forces unsafe blocks in user code and tests. Consider providing a safe helper on PathGuard to set PATH values internally and hide the unsafety from consumers.

This would improve the API design by encapsulating the unsafe operations within PathGuard itself, rather than exposing them to consumers of the API.

Context

This suggestion came up during the review of PR #105 which refactored PathGuard for injectable env and added mock testing.

Backlinks

Requested by: @leynos

Metadata

Metadata

Assignees

Labels

mediumCould be disruptive, but might not happen

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions