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

Function unwrap

src/main.rs:21–30  ·  view source on GitHub ↗
(v: Result<T, E>, f: F)

Source from the content-addressed store, hash-verified

19use crate::helper::{MyHelper, OfflineOutput};
20
21fn unwrap<T, E, F>(v: Result<T, E>, f: F)
22where
23 E: std::fmt::Debug,
24 F: FnOnce(T),
25{
26 match v {
27 Ok(res) => f(res),
28 Err(e) => eprintln!("Error: {e:?}"),
29 }
30}
31
32fn repl(opts: Opts) -> anyhow::Result<()> {
33 let mut replica = opts.replica.unwrap_or_else(|| "local".to_string());

Callers 1

replFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected