MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / arm_no_fields

Method arm_no_fields

cranelift/srcgen/src/lib.rs:365–379  ·  view source on GitHub ↗

Adds an arm that doesn't read anythings from the fields to the Match statement.

(&mut self, name: impl Into<String>, body: impl Into<String>)

Source from the content-addressed store, hash-verified

363
364 /// Adds an arm that doesn't read anythings from the fields to the Match statement.
365 pub fn arm_no_fields(&mut self, name: impl Into<String>, body: impl Into<String>) {
366 let body = body.into();
367
368 let name = name.into();
369 if name == "_" {
370 self.set_catch_all(body);
371 return;
372 }
373
374 let match_arm = self
375 .arms
376 .entry((Vec::new(), body))
377 .or_insert_with(BTreeSet::new);
378 match_arm.insert(name);
379 }
380}
381
382#[cfg(test)]

Callers 4

gen_getterFunction · 0.80
gen_bool_accessorFunction · 0.80
gen_opcodesFunction · 0.80

Calls 5

set_catch_allMethod · 0.80
or_insert_withMethod · 0.80
newFunction · 0.50
entryMethod · 0.45
insertMethod · 0.45

Tested by 1