From: Ian Jackson Date: Mon, 11 Jan 2021 00:27:21 +0000 (+0000) Subject: otterlib: wip preview X-Git-Tag: otter-0.3.0~89 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=00e17a7e26233303ae9bdc011450e22baa55a3b5;p=otter.git otterlib: wip preview Signed-off-by: Ian Jackson --- diff --git a/src/bin/otterlib.rs b/src/bin/otterlib.rs index eff1db19..cf1370a0 100644 --- a/src/bin/otterlib.rs +++ b/src/bin/otterlib.rs @@ -33,10 +33,14 @@ pub type ItemForOutput = (String, ItemEnquiryData); fn preview(items: Vec) { let pieces = items.into_iter().map(|it| { let spec = ItemSpec { lib: it.0, item: it.1.itemname }; - spec.clone().load() - .with_context(|| format!("{:?}", &spec)) - }) - .collect::,_>>()?; + (||{ + let pc = spec.clone().load().context("load")?; + let mut uos = vec![]; + pc.add_ui_operations(&mut uos).context("add uos")?; + let uos = uos.into_iter().map(|uo| uo.opname).collect::>(); + Ok::<_,AE>((pc, uos)) + })().with_context(|| format!("{:?}", &spec)) + }).collect::,_>>()?; dbg!(&pieces); }