Closed konstin closed 3 months ago
We use Range::is_empty() for special casing the empty version range in error messages. This mirrors std, which has is_empty methods on all of its collections: https://doc.rust-lang.org/nightly/std/?search=is_empty
Range::is_empty()
is_empty
Example usages:
https://github.com/astral-sh/uv/blob/8d721830db8ad75b8b7ef38edc0e346696c52e3d/crates/uv-resolver/src/pubgrub/report.rs#L553
https://github.com/astral-sh/uv/blob/8d721830db8ad75b8b7ef38edc0e346696c52e3d/crates/uv-resolver/src/pubgrub/report.rs#L565
For consistency with STD +1. The real question here is should RangeSet treat also have a is_empty or should it continue to use == VS::Empty()
== VS::Empty()
We use
Range::is_empty()
for special casing the empty version range in error messages. This mirrors std, which hasis_empty
methods on all of its collections: https://doc.rust-lang.org/nightly/std/?search=is_emptyExample usages:
https://github.com/astral-sh/uv/blob/8d721830db8ad75b8b7ef38edc0e346696c52e3d/crates/uv-resolver/src/pubgrub/report.rs#L553
https://github.com/astral-sh/uv/blob/8d721830db8ad75b8b7ef38edc0e346696c52e3d/crates/uv-resolver/src/pubgrub/report.rs#L565