From c52a2ff52e1d495255c03214e3bb703781e739aa Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 17 Mar 2021 18:45:07 +0000 Subject: [PATCH] tests/inst: cargo fmt --- tests/inst/src/destructive.rs | 23 +++++++++++------------ tests/inst/src/test.rs | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/tests/inst/src/destructive.rs b/tests/inst/src/destructive.rs index e44704cf..59ab59b1 100644 --- a/tests/inst/src/destructive.rs +++ b/tests/inst/src/destructive.rs @@ -108,21 +108,22 @@ impl RebootMark { strategy: &InterruptStrategy, ) -> &mut BTreeMap { match strategy { - InterruptStrategy::Polite(t) => self - .polite - .entry(t.clone()) - .or_insert_with(BTreeMap::new), - InterruptStrategy::Force(t) => self - .force - .entry(t.clone()) - .or_insert_with(BTreeMap::new), + InterruptStrategy::Polite(t) => { + self.polite.entry(t.clone()).or_insert_with(BTreeMap::new) + } + InterruptStrategy::Force(t) => { + self.force.entry(t.clone()).or_insert_with(BTreeMap::new) + } } } } impl InterruptStrategy { pub(crate) fn is_noop(&self) -> bool { - matches!(self, InterruptStrategy::Polite(PoliteInterruptStrategy::None)) + matches!( + self, + InterruptStrategy::Polite(PoliteInterruptStrategy::None) + ) } } @@ -598,9 +599,7 @@ fn transactionality() -> Result<()> { upgrade_and_finalize().context("Firstrun upgrade failed")?; let end = time::Instant::now(); let cycle_time = end.duration_since(start); - let tdata = TransactionalTestInfo { - cycle_time, - }; + let tdata = TransactionalTestInfo { cycle_time }; let mut f = std::io::BufWriter::new(std::fs::File::create(&TDATAPATH)?); serde_json::to_writer(&mut f, &tdata)?; f.flush()?; diff --git a/tests/inst/src/test.rs b/tests/inst/src/test.rs index 1d9c29d5..11d23ab7 100644 --- a/tests/inst/src/test.rs +++ b/tests/inst/src/test.rs @@ -82,7 +82,7 @@ pub(crate) const TEST_HTTP_BASIC_AUTH: &str = "foouser:barpw"; fn validate_authz(value: &[u8]) -> Result { let buf = std::str::from_utf8(&value)?; if let Some(o) = buf.find("Basic ") { - let (_, buf) = buf.split_at(o + "Basic ".len()); + let (_, buf) = buf.split_at(o + "Basic ".len()); let buf = base64::decode(buf).context("decoding")?; let buf = std::str::from_utf8(&buf)?; Ok(buf == TEST_HTTP_BASIC_AUTH)