@@ -12,6 +12,7 @@ use zip::ZipArchive;
1212
1313use crate :: {
1414 artifact_choosing:: platform_keywords,
15+ ci_string:: CiString ,
1516 fs:: { self , File } ,
1617 github, paths,
1718} ;
@@ -25,7 +26,7 @@ fn index_file() -> PathBuf {
2526/// Contains the current state of all of the tools that Foreman manages.
2627#[ derive( Debug , Default , Serialize , Deserialize ) ]
2728pub struct ToolCache {
28- pub tools : HashMap < String , ToolEntry > ,
29+ pub tools : HashMap < CiString , ToolEntry > ,
2930}
3031
3132impl ToolCache {
@@ -47,7 +48,7 @@ impl ToolCache {
4748 pub fn download_if_necessary ( source : & str , version_req : & VersionReq ) -> Option < Version > {
4849 let cache = Self :: load ( ) . unwrap ( ) ;
4950
50- if let Some ( tool) = cache. tools . get ( source) {
51+ if let Some ( tool) = cache. tools . get ( & CiString ( source. to_owned ( ) ) ) {
5152 log:: debug!( "Tool has some versions installed" ) ;
5253
5354 let matching_version = tool
@@ -133,7 +134,7 @@ impl ToolCache {
133134
134135 log:: trace!( "Updating tool cache" ) ;
135136 let mut cache = Self :: load ( ) . unwrap ( ) ;
136- let tool = cache. tools . entry ( source. to_owned ( ) ) . or_default ( ) ;
137+ let tool = cache. tools . entry ( CiString ( source. to_owned ( ) ) ) . or_default ( ) ;
137138 tool. versions . insert ( version. clone ( ) ) ;
138139 cache. save ( ) . unwrap ( ) ;
139140
0 commit comments