MCPcopy Create free account
hub / github.com/devashishdxt/cli-table / from_fields

Method from_fields

cli-table-derive/src/context/fields.rs:29–43  ·  view source on GitHub ↗
(syn_fields: &SynFields)

Source from the content-addressed store, hash-verified

27 }
28
29 fn from_fields(syn_fields: &SynFields) -> Result<Self> {
30 let mut fields = Vec::new();
31
32 for (index, syn_field) in syn_fields.into_iter().enumerate() {
33 let field = Field::new(syn_field, index)?;
34
35 if let Some(field) = field {
36 fields.push(field);
37 }
38 }
39
40 fields.sort_by(|left, right| left.order.cmp(&right.order));
41
42 Ok(Fields { fields })
43 }
44}
45
46pub struct Field {

Callers

nothing calls this directly

Calls 2

into_iterMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected