MCPcopy Create free account
hub / github.com/dxx/feignhttp / parse_exprs

Function parse_exprs

codegen/src/util.rs:152–169  ·  view source on GitHub ↗

Parse assignment expression like n1=v1, n2=v2, etc.

(attr_str: &str)

Source from the content-addressed store, hash-verified

150
151/// Parse assignment expression like n1=v1, n2=v2, etc.
152pub fn parse_exprs(attr_str: &str) -> HashMap<String, String> {
153 let mut expr_map = HashMap::new();
154 if attr_str == "" {
155 return expr_map;
156 }
157
158 let attrs = attr_str.split(",");
159 let exprs: Vec<&str> = attrs.into_iter().map(|u| u).collect();
160 for exp_str in exprs.into_iter() {
161 let expr = match syn::parse_str::<Meta>(exp_str) {
162 Ok(x) => x,
163 Err(_) => return HashMap::new(),
164 };
165 expr_map.insert(expr.0, expr.1);
166 }
167
168 expr_map
169}
170
171pub fn parse_args_from_sig(sig: &mut syn::Signature) -> syn::Result<Vec<FnArg>> {
172 let iter = sig

Callers 2

http_implFunction · 0.85
feign_implFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected