Primary finding
Unnecessary unsafe blocks around std::env::set_var/remove_var in tests trigger unused_unsafe and hinder deny(warnings) builds
- src/core/jsonrpc_cors_tests.rs:81-90
- src/core/jsonrpc_cors_tests.rs:98-103
std::env::set_var and std::env::remove_var are safe functions and do not require unsafe. Wrapping them in unsafe blocks produces the unused_unsafe lint. In projects that treat warnings as errors (e.g., RUSTFLAGS=-D warnings or CI pipelines), this will fail the build/test. It also miscommunicates that a memory-unsafe operation is occurring when it is not.
Recommendation
Remove both unsafe blocks. Keep the explanatory comment if desired. If you want to prevent future accidental introduction of unsafe code in tests, consider adding #![deny(unsafe_code)] at the top of the test module or enabling the corresponding lint in CI.