MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / for_arguments

Method for_arguments

crates/codegen/src/rust.rs:893–909  ·  view source on GitHub ↗
(module: &ModuleDef, params: &[(Identifier, AlgebraicTypeUse)])

Source from the content-addressed store, hash-verified

891
892impl FormattedArglist {
893 fn for_arguments(module: &ModuleDef, params: &[(Identifier, AlgebraicTypeUse)]) -> Self {
894 let mut arglist_no_delimiters = String::new();
895 write_arglist_no_delimiters(module, &mut arglist_no_delimiters, params, None)
896 .expect("Writing to a String failed... huh?");
897
898 let mut arg_names = String::new();
899 for (arg_ident, _) in params {
900 let arg_name = arg_ident.deref().to_case(Case::Snake);
901 arg_names += &arg_name;
902 arg_names += ", ";
903 }
904
905 Self {
906 arglist_no_delimiters,
907 arg_names,
908 }
909 }
910}
911
912const ALLOW_LINTS: &str = "#![allow(unused, clippy::all)]";

Callers

nothing calls this directly

Calls 4

to_caseMethod · 0.80
newFunction · 0.50
derefMethod · 0.45

Tested by

no test coverage detected