From 30e903e2ba02b08aee897c205584c71458d08dec Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Tue, 27 Feb 2024 11:00:58 -0500 Subject: [PATCH] pep440: remove redundant `without_local()` (#2019) In this context, we already know (as the comment says) that `self` does not have a local segment, so we don't need to strip it. This change isn't motivated by anything other than making the code and comment in sync. For example, when I first looked at it, I wondered whether the extra stripping was somehow necessary. But it isn't. --- crates/pep440-rs/src/version_specifier.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/pep440-rs/src/version_specifier.rs b/crates/pep440-rs/src/version_specifier.rs index 2b2ad756b..af1873963 100644 --- a/crates/pep440-rs/src/version_specifier.rs +++ b/crates/pep440-rs/src/version_specifier.rs @@ -417,10 +417,7 @@ impl VersionSpecifier { (self.version.clone(), version.clone()) } else { // self is already without local - ( - self.version.clone().without_local(), - version.clone().without_local(), - ) + (self.version.clone(), version.clone().without_local()) }; match self.operator {