Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit cebfa81

Browse files
authored
Fixes for Rust 1.89 (#313)
* Fixes for Rust 1.89 * move comment
1 parent 62f3644 commit cebfa81

3 files changed

Lines changed: 26 additions & 29 deletions

File tree

golem-cli/src/app/build/gen_rpc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ async fn create_generated_base_wit(
221221
{
222222
ctx.component_base_output_wit_deps(dep_component_name)?
223223
.add_packages_with_transitive_deps_to_wit_dir(
224-
&[dep_exports_package_name.clone()],
224+
std::slice::from_ref(dep_exports_package_name),
225225
&component_generated_base_wit,
226226
)?;
227227
}

golem-cli/src/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ impl<P: AsRef<Path>> PathExtra<P> {
274274
self.0.as_ref().into()
275275
}
276276

277-
pub fn display(&self) -> std::path::Display {
277+
pub fn display(&self) -> std::path::Display<'_> {
278278
self.as_path().display()
279279
}
280280
}

golem-cli/src/model/worker.rs

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -45,33 +45,30 @@ pub fn fuzzy_match_function_name(
4545
let fuzzy_search = FuzzySearch::new(component_function_names.iter().map(|s| s.as_str()));
4646
match fuzzy_search.find(&normalized_function_name) {
4747
Ok(matched) => {
48-
// 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
49-
// because it may have resource parameters
50-
if parsed_function_name.is_some()
51-
&& (!matched.exact_match
52-
|| parsed_function_name
53-
.iter()
54-
.any(|f| f.function.is_indexed_resource()))
55-
{
56-
let mut parsed_function_name = parsed_function_name.unwrap();
57-
let parsed_matched_function_name = ParsedFunctionName::parse(&matched.option)
58-
.expect("The rendered component export names should always be parseable");
59-
60-
adjust_parsed_function_name(
61-
&mut parsed_function_name,
62-
parsed_matched_function_name,
63-
normalized_function_name,
64-
)?;
65-
66-
let rendered_altered_function_name = parsed_function_name.to_string();
67-
Ok(Match {
68-
option: rendered_altered_function_name,
69-
pattern: matched.pattern,
70-
exact_match: false,
71-
})
72-
} else {
73-
// otherwise we just return the matched raw function name
74-
Ok(normalized(matched))
48+
match parsed_function_name {
49+
// 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
50+
// because it may have resource parameters
51+
Some(mut parsed_function_name)
52+
if !matched.exact_match
53+
|| parsed_function_name.function.is_indexed_resource() =>
54+
{
55+
let parsed_matched_function_name = ParsedFunctionName::parse(&matched.option)
56+
.expect("The rendered component export names should always be parseable");
57+
58+
adjust_parsed_function_name(
59+
&mut parsed_function_name,
60+
parsed_matched_function_name,
61+
normalized_function_name,
62+
)?;
63+
64+
let rendered_altered_function_name = parsed_function_name.to_string();
65+
Ok(Match {
66+
option: rendered_altered_function_name,
67+
pattern: matched.pattern,
68+
exact_match: false,
69+
})
70+
}
71+
_ => Ok(normalized(matched)),
7572
}
7673
}
7774
Err(Error::Ambiguous {

0 commit comments

Comments
 (0)