From da28740e05a8736fa1eb6f50cfb2f4812279b1e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Istv=C3=A1n=20B=C3=ADr=C3=B3?= Date: Thu, 7 Aug 2025 17:25:00 +0200 Subject: [PATCH 1/2] Fixes for Rust 1.89 --- golem-cli/src/app/build/gen_rpc.rs | 2 +- golem-cli/src/fs.rs | 2 +- golem-cli/src/model/worker.rs | 48 ++++++++++++++---------------- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/golem-cli/src/app/build/gen_rpc.rs b/golem-cli/src/app/build/gen_rpc.rs index 2c2ee2640..1473399d7 100644 --- a/golem-cli/src/app/build/gen_rpc.rs +++ b/golem-cli/src/app/build/gen_rpc.rs @@ -221,7 +221,7 @@ async fn create_generated_base_wit( { ctx.component_base_output_wit_deps(dep_component_name)? .add_packages_with_transitive_deps_to_wit_dir( - &[dep_exports_package_name.clone()], + std::slice::from_ref(dep_exports_package_name), &component_generated_base_wit, )?; } diff --git a/golem-cli/src/fs.rs b/golem-cli/src/fs.rs index ba5d60732..46fa5daa5 100644 --- a/golem-cli/src/fs.rs +++ b/golem-cli/src/fs.rs @@ -274,7 +274,7 @@ impl> PathExtra

{ self.0.as_ref().into() } - pub fn display(&self) -> std::path::Display { + pub fn display(&self) -> std::path::Display<'_> { self.as_path().display() } } diff --git a/golem-cli/src/model/worker.rs b/golem-cli/src/model/worker.rs index 5bc43a03c..8f40c3e3f 100644 --- a/golem-cli/src/model/worker.rs +++ b/golem-cli/src/model/worker.rs @@ -47,31 +47,29 @@ pub fn fuzzy_match_function_name( Ok(matched) => { // if we have a match, but it is non-exact _or_ we have a parsed function name, we customize the parsed function name and render it // because it may have resource parameters - if parsed_function_name.is_some() - && (!matched.exact_match - || parsed_function_name - .iter() - .any(|f| f.function.is_indexed_resource())) - { - let mut parsed_function_name = parsed_function_name.unwrap(); - let parsed_matched_function_name = ParsedFunctionName::parse(&matched.option) - .expect("The rendered component export names should always be parseable"); - - adjust_parsed_function_name( - &mut parsed_function_name, - parsed_matched_function_name, - normalized_function_name, - )?; - - let rendered_altered_function_name = parsed_function_name.to_string(); - Ok(Match { - option: rendered_altered_function_name, - pattern: matched.pattern, - exact_match: false, - }) - } else { - // otherwise we just return the matched raw function name - Ok(normalized(matched)) + + match parsed_function_name { + Some(mut parsed_function_name) + if !matched.exact_match + || parsed_function_name.function.is_indexed_resource() => + { + let parsed_matched_function_name = ParsedFunctionName::parse(&matched.option) + .expect("The rendered component export names should always be parseable"); + + adjust_parsed_function_name( + &mut parsed_function_name, + parsed_matched_function_name, + normalized_function_name, + )?; + + let rendered_altered_function_name = parsed_function_name.to_string(); + Ok(Match { + option: rendered_altered_function_name, + pattern: matched.pattern, + exact_match: false, + }) + } + _ => Ok(normalized(matched)), } } Err(Error::Ambiguous { From 23e9b71075d2dd8ab9a5683c11fe4c1001cde0b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Istv=C3=A1n=20B=C3=ADr=C3=B3?= Date: Thu, 7 Aug 2025 17:27:25 +0200 Subject: [PATCH 2/2] move comment --- golem-cli/src/model/worker.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/golem-cli/src/model/worker.rs b/golem-cli/src/model/worker.rs index 8f40c3e3f..8e9cda350 100644 --- a/golem-cli/src/model/worker.rs +++ b/golem-cli/src/model/worker.rs @@ -45,10 +45,9 @@ pub fn fuzzy_match_function_name( let fuzzy_search = FuzzySearch::new(component_function_names.iter().map(|s| s.as_str())); match fuzzy_search.find(&normalized_function_name) { Ok(matched) => { - // if we have a match, but it is non-exact _or_ we have a parsed function name, we customize the parsed function name and render it - // because it may have resource parameters - match parsed_function_name { + // if we have a match, but it is non-exact _or_ we have a parsed function name, we customize the parsed function name and render it + // because it may have resource parameters Some(mut parsed_function_name) if !matched.exact_match || parsed_function_name.function.is_indexed_resource() =>