File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 6363
6464use crate :: util:: cache_lock:: { CacheLock , CacheLockMode , CacheLocker } ;
6565use std:: borrow:: Cow ;
66- use std:: collections:: hash_map:: Entry :: Vacant ;
6766use std:: collections:: { HashMap , HashSet } ;
6867use std:: env;
6968use std:: ffi:: { OsStr , OsString } ;
@@ -1714,11 +1713,10 @@ impl GlobalContext {
17141713 let ( value_map, def) = value. table_mut ( "<root>" ) ?;
17151714
17161715 if let Some ( token) = value_map. remove ( "token" ) {
1717- if let Vacant ( entry ) = value_map. entry ( "registry" . into ( ) ) {
1716+ value_map. entry ( "registry" . into ( ) ) . or_insert_with ( || {
17181717 let map = HashMap :: from ( [ ( "token" . into ( ) , token) ] ) ;
1719- let table = CV :: Table ( map, def. clone ( ) ) ;
1720- entry. insert ( table) ;
1721- }
1718+ CV :: Table ( map, def. clone ( ) )
1719+ } ) ;
17221720 }
17231721 }
17241722
You can’t perform that action at this time.
0 commit comments