MCPcopy Create free account
hub / github.com/dfinity/ic-repl / from_fields

Function from_fields

src/selector.rs:152–167  ·  view source on GitHub ↗
(fs: Vec<IDLField>)

Source from the content-addressed store, hash-verified

150}
151
152fn from_fields(fs: Vec<IDLField>) -> Vec<IDLValue> {
153 fs.into_iter()
154 .map(|f| {
155 IDLValue::Record(vec![
156 IDLField {
157 id: Label::Id(0),
158 val: IDLValue::Text(format!("{}", f.id)),
159 },
160 IDLField {
161 id: Label::Id(1),
162 val: f.val,
163 },
164 ])
165 })
166 .collect()
167}
168fn from_text(s: String) -> Vec<IDLValue> {
169 s.chars().map(|c| IDLValue::Text(c.to_string())).collect()
170}

Callers 1

projectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected