MCPcopy Create free account
hub / github.com/csskit/csskit / from_fields

Method from_fields

crates/csskit_derives/src/parse.rs:178–192  ·  view source on GitHub ↗
(fields: &Fields)

Source from the content-addressed store, hash-verified

176 }
177
178 fn from_fields(fields: &Fields) -> Result<Vec<Self>> {
179 fields
180 .views()
181 .into_iter()
182 .zip(fields.iter())
183 .map(|(view, syn_field)| {
184 Ok(Self {
185 var: view.binding,
186 ty: view.ty.clone(),
187 arg: ParseArg::from_attributes(&syn_field.attrs)?,
188 atom: extract_atom(&syn_field.attrs)?,
189 })
190 })
191 .collect()
192 }
193
194 fn atom_path_string(&self) -> Option<String> {
195 self.atom.as_ref().map(|a| quote!(#a).to_string())

Callers

nothing calls this directly

Calls 6

extract_atomFunction · 0.85
collectMethod · 0.80
into_iterMethod · 0.80
viewsMethod · 0.80
iterMethod · 0.80
cloneMethod · 0.80

Tested by

no test coverage detected