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

Function to_text

src/selector.rs:171–182  ·  view source on GitHub ↗
(from: Vec<IDLValue>)

Source from the content-addressed store, hash-verified

169 s.chars().map(|c| IDLValue::Text(c.to_string())).collect()
170}
171fn to_text(from: Vec<IDLValue>) -> Result<String> {
172 use std::fmt::Write;
173 let mut res = String::with_capacity(from.len());
174 for v in from.into_iter() {
175 if let IDLValue::Text(s) = v {
176 write!(&mut res, "{s}")?;
177 } else {
178 return Err(anyhow!("expect function to return text"));
179 }
180 }
181 Ok(res)
182}
183fn to_field(from: Vec<IDLValue>) -> Result<Vec<IDLField>> {
184 let mut fs = Vec::with_capacity(from.len());
185 for v in from.into_iter() {

Callers 1

projectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected