MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / let_results

Method let_results

crates/rust/src/bindgen.rs:74–97  ·  view source on GitHub ↗
(&mut self, amt: usize, results: &mut Vec<String>)

Source from the content-addressed store, hash-verified

72 }
73
74 fn let_results(&mut self, amt: usize, results: &mut Vec<String>) {
75 match amt {
76 0 => {}
77 1 => {
78 let tmp = self.tmp();
79 let res = format!("result{tmp}");
80 self.push_str("let ");
81 self.push_str(&res);
82 results.push(res);
83 self.push_str(" = ");
84 }
85 n => {
86 let tmp = self.tmp();
87 self.push_str("let (");
88 for i in 0..n {
89 let arg = format!("result{tmp}_{i}");
90 self.push_str(&arg);
91 self.push_str(",");
92 results.push(arg);
93 }
94 self.push_str(") = ");
95 }
96 }
97 }
98
99 fn record_lower(
100 &mut self,

Callers 1

emitMethod · 0.45

Calls 3

tmpMethod · 0.45
push_strMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected