MCPcopy Create free account
hub / github.com/Wulf/create-rust-app / build_args_string

Method build_args_string

crates/qsync/src/hook.rs:56–93  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

54/// ```
55impl Hook {
56 fn build_args_string(&self) -> String {
57 //=============================== Build Hook Args
58
59 let mut hook_args = String::new();
60
61 for (index, arg) in self.path_params.iter().enumerate() {
62 let _ = write!(hook_args, "{}: {}", arg.hook_arg_name, arg.hook_arg_type);
63 if index != self.path_params.len() - 1 {
64 hook_args.push_str(", ");
65 }
66 }
67
68 if !self.path_params.is_empty() && !self.query_params.is_empty() {
69 hook_args.push_str(", ");
70 }
71
72 for (index, arg) in self.query_params.iter().enumerate() {
73 let _ = write!(hook_args, "{}: {}", arg.hook_arg_name, arg.hook_arg_type);
74 if index != self.query_params.len() - 1 {
75 hook_args.push_str(", ");
76 }
77 }
78
79 if (!self.path_params.is_empty() || !self.query_params.is_empty())
80 && !self.body_params.is_empty()
81 {
82 hook_args.push_str(", ");
83 }
84
85 for (index, arg) in self.body_params.iter().enumerate() {
86 let _ = write!(hook_args, "{}: {}", arg.hook_arg_name, arg.hook_arg_type);
87 if index != self.body_params.len() - 1 {
88 hook_args.push_str(", ");
89 }
90 }
91
92 hook_args
93 }
94
95 fn build_vars_string(&self) -> String {
96 //=============================== Build Variables

Callers 1

to_stringMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected