From 8297ef4f2672e9eb36a5a069ce0d545c61cbfbd0 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 28 Feb 2021 15:31:03 +0000 Subject: [PATCH] otterlib: Use explicit calls to GPiece::dummy() This makes it clearer where we are cutting this corner. Signed-off-by: Ian Jackson --- src/bin/otterlib.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/bin/otterlib.rs b/src/bin/otterlib.rs index 1af8ab79..aa34c5c6 100644 --- a/src/bin/otterlib.rs +++ b/src/bin/otterlib.rs @@ -93,8 +93,7 @@ fn preview(items: Vec) { (||{ let pc = spec.clone().load().context("load")?; let mut uos = vec![]; - let gpc_dummy = GPiece::dummy(); - pc.add_ui_operations(&mut uos, &gpc_dummy).context("add uos")?; + pc.add_ui_operations(&mut uos, &GPiece::dummy()).context("add uos")?; let uos = uos.into_iter().map(|uo| uo.opname).collect::>(); let spec = spec.clone(); @@ -120,8 +119,6 @@ fn preview(items: Vec) { let max_facecols = pieces.iter().map(|s| s.face_cols()).max().unwrap_or(1); let max_uos = pieces.iter().map(|s| s.uos.len()).max().unwrap_or(0); - let gpc_dummy = GPiece::dummy(); - println!("{}", &HTML_PRELUDE); println!(r#""#); for s in &pieces { @@ -132,7 +129,7 @@ fn preview(items: Vec) { println!(r#""#, Html::from_txt(&spec.item).0); println!(r#""#, - pc.describe_html(&gpc_dummy)?.0); + pc.describe_html(&GPiece::dummy())?.0); let only1 = s.face_cols() == 1; for facecol in 0..(if only1 { 1 } else { max_facecols }) { -- 2.30.2
{}{}