Skip to content

Remove unnecessary unsafe blocks from environment variable operations in tests #87

@coderabbitai

Description

@coderabbitai

Context

This issue was identified during the review of PR #82 and requested by @leynos.

Description

The test function run_respects_env_override_for_ninja in tests/runner_tests.rs uses unsafe blocks when calling std::env::set_var and std::env::remove_var. These functions are safe to call and do not require unsafe blocks.

The unnecessary unsafe blocks should be removed while maintaining the existing logic that:

  • Saves the original environment variable value
  • Sets the override for testing
  • Runs the test
  • Restores the original state

References

Files affected

  • tests/runner_tests.rs (Lines 166-202)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions