From: Ian Jackson Date: Fri, 26 Feb 2021 11:15:41 +0000 (+0000) Subject: apitest: process pieces X-Git-Tag: otter-0.4.0~354 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=3f4aca4df1c66b7ccd71eb425e4b4cdbcaf58e3c;p=otter.git apitest: process pieces Signed-off-by: Ian Jackson --- diff --git a/apitest.rs b/apitest.rs index 076e88f7..c245559d 100644 --- a/apitest.rs +++ b/apitest.rs @@ -15,6 +15,7 @@ pub use imports::*; pub use anyhow::{anyhow, ensure, Context}; +pub use arrayvec::ArrayVec; pub use boolinator::Boolinator; pub use fehler::{throw, throws}; pub use if_chain::if_chain; diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index fda71406..c438f172 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -163,11 +163,10 @@ impl Ctx { Some(EXIT_NOTFOUND)); let session = self.connect_player(&self.alice)?; - - for (_, info) in session.pieces()? { - let desc = &info["desc"]; - dbg!(&desc); - } + let llm: [_;2] = session.pieces()?.into_iter() + .filter(|(_,info)| info["desc"] == "a library load area marker") + .collect::>().into_inner().unwrap(); + dbg!(llm); // xxx find load markers ids // xxx find load markers' locations