diff options
author | Colin Walters <walters@verbum.org> | 2021-03-17 18:45:07 +0000 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2021-03-17 18:45:17 +0000 |
commit | c52a2ff52e1d495255c03214e3bb703781e739aa (patch) | |
tree | 5f595201706f6b41e2a3f3d49a22c8711f96098c /tests | |
parent | 92e2bc397bb5f39e2befa892b47d77af925597c8 (diff) | |
download | ostree-c52a2ff52e1d495255c03214e3bb703781e739aa.tar.gz |
tests/inst: cargo fmt
Diffstat (limited to 'tests')
-rw-r--r-- | tests/inst/src/destructive.rs | 23 | ||||
-rw-r--r-- | 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<UpdateResult, u32> { 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<bool> { 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) |