Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(grain): switch -> to => in type signatures #4

Open
wants to merge 1 commit into
base: grain
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/grain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ impl GrainInterfaceGenerator<'_> {
.map(|param| wasm_type(*param))
.collect();
self.push_str(&params.join(", "));
self.push_str(") -> ");
self.push_str(") => ");
match wasm_sig.results.len() {
0 => self.push_str("Void"),
1 => {
Expand Down Expand Up @@ -796,10 +796,10 @@ impl<'a> InterfaceGenerator<'a> for GrainInterfaceGenerator<'a> {
self.src.push_str(&format!(
r#"
@externalName("[resource-new]{name}")
foreign wasm new{name_upper}: WasmI32 -> WasmI32 from "[export]{module}"
foreign wasm new{name_upper}: WasmI32 => WasmI32 from "[export]{module}"

@externalName("[resource-rep]{name}")
foreign wasm rep{name_upper}: WasmI32 -> WasmI32 from "[export]{module}"
foreign wasm rep{name_upper}: WasmI32 => WasmI32 from "[export]{module}"

@unsafe
let new{name_upper} = (rep) => {{
Expand Down Expand Up @@ -1289,7 +1289,7 @@ pub trait GrainGenerator {
self.push_str(", ");
}
}
self.push_str(") -> ");
self.push_str(") => ");
self.print_results(resolve, func);
self.push_str(" = (");
for (i, (name, _)) in func.params.iter().enumerate() {
Expand Down
Loading