Avoid returning Some for narrowing no-ops (#10705)
The net effect here is (I think) just that we end up logging more "narrowing" outcomes than we have in practice.
This commit is contained in:
@@ -115,7 +115,12 @@ impl RequiresPython {
|
||||
}
|
||||
|
||||
/// Narrow the [`RequiresPython`] by computing the intersection with the given range.
|
||||
///
|
||||
/// Returns `None` if the given range is not narrower than the current range.
|
||||
pub fn narrow(&self, range: &RequiresPythonRange) -> Option<Self> {
|
||||
if *range == self.range {
|
||||
return None;
|
||||
}
|
||||
let lower = if range.0 >= self.range.0 {
|
||||
Some(&range.0)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user