From 00e17a7e26233303ae9bdc011450e22baa55a3b5 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 11 Jan 2021 00:27:21 +0000 Subject: [PATCH] otterlib: wip preview Signed-off-by: Ian Jackson --- src/bin/otterlib.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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); } -- 2.30.2