@@ -77,7 +77,7 @@ pub enum InstalledDist {
77
77
pub struct InstalledRegistryDist {
78
78
pub name : PackageName ,
79
79
pub version : Version ,
80
- pub path : PathBuf ,
80
+ pub path : Box < Path > ,
81
81
pub cache_info : Option < CacheInfo > ,
82
82
}
83
83
@@ -88,32 +88,32 @@ pub struct InstalledDirectUrlDist {
88
88
pub direct_url : Box < DirectUrl > ,
89
89
pub url : Url ,
90
90
pub editable : bool ,
91
- pub path : PathBuf ,
91
+ pub path : Box < Path > ,
92
92
pub cache_info : Option < CacheInfo > ,
93
93
}
94
94
95
95
#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
96
96
pub struct InstalledEggInfoFile {
97
97
pub name : PackageName ,
98
98
pub version : Version ,
99
- pub path : PathBuf ,
99
+ pub path : Box < Path > ,
100
100
}
101
101
102
102
#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
103
103
pub struct InstalledEggInfoDirectory {
104
104
pub name : PackageName ,
105
105
pub version : Version ,
106
- pub path : PathBuf ,
106
+ pub path : Box < Path > ,
107
107
}
108
108
109
109
#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
110
110
pub struct InstalledLegacyEditable {
111
111
pub name : PackageName ,
112
112
pub version : Version ,
113
- pub egg_link : PathBuf ,
114
- pub target : PathBuf ,
113
+ pub egg_link : Box < Path > ,
114
+ pub target : Box < Path > ,
115
115
pub target_url : Url ,
116
- pub egg_info : PathBuf ,
116
+ pub egg_info : Box < Path > ,
117
117
}
118
118
119
119
impl InstalledDist {
@@ -145,15 +145,15 @@ impl InstalledDist {
145
145
editable : matches ! ( & direct_url, DirectUrl :: LocalDirectory { dir_info, .. } if dir_info. editable == Some ( true ) ) ,
146
146
direct_url : Box :: new ( direct_url) ,
147
147
url,
148
- path : path. to_path_buf ( ) ,
148
+ path : path. to_path_buf ( ) . into_boxed_path ( ) ,
149
149
cache_info,
150
150
} ) ) ) ,
151
151
Err ( err) => {
152
152
warn ! ( "Failed to parse direct URL: {err}" ) ;
153
153
Ok ( Some ( Self :: Registry ( InstalledRegistryDist {
154
154
name,
155
155
version,
156
- path : path. to_path_buf ( ) ,
156
+ path : path. to_path_buf ( ) . into_boxed_path ( ) ,
157
157
cache_info,
158
158
} ) ) )
159
159
}
@@ -162,7 +162,7 @@ impl InstalledDist {
162
162
Ok ( Some ( Self :: Registry ( InstalledRegistryDist {
163
163
name,
164
164
version,
165
- path : path. to_path_buf ( ) ,
165
+ path : path. to_path_buf ( ) . into_boxed_path ( ) ,
166
166
cache_info,
167
167
} ) ) )
168
168
} ;
@@ -191,15 +191,15 @@ impl InstalledDist {
191
191
return Ok ( Some ( Self :: EggInfoDirectory ( InstalledEggInfoDirectory {
192
192
name : file_name. name ,
193
193
version,
194
- path : path. to_path_buf ( ) ,
194
+ path : path. to_path_buf ( ) . into_boxed_path ( ) ,
195
195
} ) ) ) ;
196
196
}
197
197
198
198
if metadata. is_file ( ) {
199
199
return Ok ( Some ( Self :: EggInfoFile ( InstalledEggInfoFile {
200
200
name : file_name. name ,
201
201
version,
202
- path : path. to_path_buf ( ) ,
202
+ path : path. to_path_buf ( ) . into_boxed_path ( ) ,
203
203
} ) ) ) ;
204
204
}
205
205
} ;
@@ -211,7 +211,7 @@ impl InstalledDist {
211
211
return Ok ( Some ( Self :: EggInfoDirectory ( InstalledEggInfoDirectory {
212
212
name : file_name. name ,
213
213
version : Version :: from_str ( & egg_metadata. version ) ?,
214
- path : path. to_path_buf ( ) ,
214
+ path : path. to_path_buf ( ) . into_boxed_path ( ) ,
215
215
} ) ) ) ;
216
216
}
217
217
@@ -222,7 +222,7 @@ impl InstalledDist {
222
222
return Ok ( Some ( Self :: EggInfoDirectory ( InstalledEggInfoDirectory {
223
223
name : file_name. name ,
224
224
version : Version :: from_str ( & egg_metadata. version ) ?,
225
- path : path. to_path_buf ( ) ,
225
+ path : path. to_path_buf ( ) . into_boxed_path ( ) ,
226
226
} ) ) ) ;
227
227
}
228
228
}
@@ -270,10 +270,10 @@ impl InstalledDist {
270
270
return Ok ( Some ( Self :: LegacyEditable ( InstalledLegacyEditable {
271
271
name : egg_metadata. name ,
272
272
version : Version :: from_str ( & egg_metadata. version ) ?,
273
- egg_link : path. to_path_buf ( ) ,
274
- target,
273
+ egg_link : path. to_path_buf ( ) . into_boxed_path ( ) ,
274
+ target : target . into_boxed_path ( ) ,
275
275
target_url : url,
276
- egg_info,
276
+ egg_info : egg_info . into_boxed_path ( ) ,
277
277
} ) ) ) ;
278
278
}
279
279
@@ -344,7 +344,7 @@ impl InstalledDist {
344
344
}
345
345
Self :: EggInfoFile ( _) | Self :: EggInfoDirectory ( _) | Self :: LegacyEditable ( _) => {
346
346
let path = match self {
347
- Self :: EggInfoFile ( dist) => Cow :: Borrowed ( & dist. path ) ,
347
+ Self :: EggInfoFile ( dist) => Cow :: Borrowed ( & * dist. path ) ,
348
348
Self :: EggInfoDirectory ( dist) => Cow :: Owned ( dist. path . join ( "PKG-INFO" ) ) ,
349
349
Self :: LegacyEditable ( dist) => Cow :: Owned ( dist. egg_info . join ( "PKG-INFO" ) ) ,
350
350
_ => unreachable ! ( ) ,
0 commit comments