File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ enum PackageManager {
5959impl 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 }
You can’t perform that action at this time.
0 commit comments