File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -276,9 +276,8 @@ impl<T> Artifacts<T> {
276
276
pub fn artifacts < O : ArtifactOutput < Artifact = T > > (
277
277
& self ,
278
278
) -> impl Iterator < Item = ( ArtifactId , & T ) > + ' _ {
279
- self . 0 . iter ( ) . flat_map ( |( file , contract_artifacts) | {
279
+ self . 0 . iter ( ) . flat_map ( |( source , contract_artifacts) | {
280
280
contract_artifacts. iter ( ) . flat_map ( move |( _contract_name, artifacts) | {
281
- let source = file. clone ( ) ;
282
281
artifacts. iter ( ) . filter_map ( move |artifact| {
283
282
O :: contract_name ( & artifact. file ) . map ( |name| {
284
283
(
@@ -302,9 +301,9 @@ impl<T> Artifacts<T> {
302
301
pub fn into_artifacts < O : ArtifactOutput < Artifact = T > > (
303
302
self ,
304
303
) -> impl Iterator < Item = ( ArtifactId , T ) > {
305
- self . 0 . into_iter ( ) . flat_map ( |( file , contract_artifacts) | {
304
+ self . 0 . into_iter ( ) . flat_map ( |( source , contract_artifacts) | {
306
305
contract_artifacts. into_iter ( ) . flat_map ( move |( _contract_name, artifacts) | {
307
- let source = file . clone ( ) ;
306
+ let source = source . clone ( ) ;
308
307
artifacts. into_iter ( ) . filter_map ( move |artifact| {
309
308
O :: contract_name ( & artifact. file ) . map ( |name| {
310
309
(
Original file line number Diff line number Diff line change @@ -279,7 +279,11 @@ pub(crate) fn cache_version(
279
279
f : impl FnOnce ( & Path ) -> Result < Version > ,
280
280
) -> Result < Version > {
281
281
static VERSION_CACHE : OnceLock < Mutex < HashMap < PathBuf , Version > > > = OnceLock :: new ( ) ;
282
- Ok ( match VERSION_CACHE . get_or_init ( || Mutex :: new ( HashMap :: new ( ) ) ) . lock ( ) . unwrap ( ) . entry ( path) {
282
+ let mut lock = VERSION_CACHE
283
+ . get_or_init ( || Mutex :: new ( HashMap :: new ( ) ) )
284
+ . lock ( )
285
+ . unwrap_or_else ( std:: sync:: PoisonError :: into_inner) ;
286
+ Ok ( match lock. entry ( path) {
283
287
std:: collections:: hash_map:: Entry :: Occupied ( entry) => entry. into_mut ( ) ,
284
288
std:: collections:: hash_map:: Entry :: Vacant ( entry) => {
285
289
let value = f ( entry. key ( ) ) ?;
You can’t perform that action at this time.
0 commit comments