Skip to content

Commit 3a8664f

Browse files
committed
fix(clippy): address lints
1 parent 43643e3 commit 3a8664f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/providers/python.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ enum PackageManager {
5959
impl PackageManager {
6060
fn from_env(env: &Environment) -> Self {
6161
env.get_config_variable("PYTHON_PACKAGE_MANAGER")
62-
.map(|s| match s.to_lowercase().as_str() {
62+
.map_or(Self::Auto, |s| match s.to_lowercase().as_str() {
6363
"auto" => Self::Auto,
6464
"requirements" => Self::Specified(PackageManagerType::PipReqs),
6565
"setuptools" => Self::Specified(PackageManagerType::PipSetuptools),
@@ -70,16 +70,14 @@ impl PackageManager {
7070
"skip" => Self::Skip,
7171
_ => {
7272
eprintln!(
73-
"Warning: Unknown package manager '{}'. Using auto-detection.",
74-
s
73+
"Warning: Unknown package manager '{s}'. Using auto-detection.",
7574
);
7675
Self::Auto
7776
}
7877
})
79-
.unwrap_or(Self::Auto)
8078
}
8179

82-
fn resolve(&self, app: &App) -> Action {
80+
fn resolve(self, app: &App) -> Action {
8381
match self {
8482
// Auto-detect package manager if not explicitly specified
8583
Self::Auto => {
@@ -101,7 +99,7 @@ impl PackageManager {
10199
Action::NoInstallation // Default fallback
102100
}
103101
}
104-
Self::Specified(manager) => Action::InstallWith(*manager),
102+
Self::Specified(manager) => Action::InstallWith(manager),
105103
Self::Skip => Action::NoInstallation,
106104
}
107105
}

0 commit comments

Comments
 (0)