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

Function rust_function_name

crates/wit-bindgen/src/lib.rs:3737–3747  ·  view source on GitHub ↗
(func: &Function)

Source from the content-addressed store, hash-verified

3735}
3736
3737fn rust_function_name(func: &Function) -> String {
3738 match func.kind {
3739 FunctionKind::Constructor(_) => "new".to_string(),
3740 FunctionKind::Method(_)
3741 | FunctionKind::Static(_)
3742 | FunctionKind::AsyncMethod(_)
3743 | FunctionKind::AsyncStatic(_)
3744 | FunctionKind::Freestanding
3745 | FunctionKind::AsyncFreestanding => to_rust_ident(func.item_name()),
3746 }
3747}
3748
3749fn func_field_name(resolve: &Resolve, func: &Function) -> String {
3750 let mut name = String::new();

Calls 2

to_rust_identFunction · 0.85
to_stringMethod · 0.45

Tested by

no test coverage detected