diff --git a/crates/arti-client/src/client.rs b/crates/arti-client/src/client.rs index 2e3e67a35..4c0ad4136 100644 --- a/crates/arti-client/src/client.rs +++ b/crates/arti-client/src/client.rs @@ -314,7 +314,10 @@ impl StreamPrefs { /// If `Auto`, the behaviour depends on the `address_filter.allow_onion_addrs` /// configuration option, which is in turn enabled by default. #[cfg(feature = "onion-service-client")] - pub fn connect_to_onion_services(&mut self, connect_to_onion_services: BoolOrAuto) -> &mut Self { + pub fn connect_to_onion_services( + &mut self, + connect_to_onion_services: BoolOrAuto, + ) -> &mut Self { self.connect_to_onion_services = connect_to_onion_services; self } diff --git a/crates/tor-hsclient/src/connect.rs b/crates/tor-hsclient/src/connect.rs index 25b203a8d..26c259a9c 100644 --- a/crates/tor-hsclient/src/connect.rs +++ b/crates/tor-hsclient/src/connect.rs @@ -410,7 +410,7 @@ impl<'c, R: Runtime, M: MocksForConnect> Context<'c, R, M> { /// Returns an error if no valid descriptor could be found. async fn descriptor_ensure<'d>(&self, data: &'d mut DataHsDesc) -> Result<&'d HsDesc, CE> { let _ = self.config.retry; // TODO HS actually use this value - // TODO HS Use `hs_desc_fetch_attempts` from configuration + // TODO HS Use `hs_desc_fetch_attempts` from configuration /// Maxmimum number of hsdir connection and retrieval attempts we'll make const MAX_TOTAL_ATTEMPTS: usize = 6; /// Limit on the duration of each retrieval attempt @@ -1495,7 +1495,16 @@ mod test { secret_keys_builder.ks_hsc_desc_enc(sk); let secret_keys = secret_keys_builder.build().unwrap(); - let ctx = Context::new(&runtime, &mocks, netdir, Default::default(), hsid, secret_keys, mocks.clone()).unwrap(); + let ctx = Context::new( + &runtime, + &mocks, + netdir, + Default::default(), + hsid, + secret_keys, + mocks.clone(), + ) + .unwrap(); let _got = AssertUnwindSafe(ctx.connect(&mut data)) .catch_unwind() // TODO HS TESTS: remove this and the AssertUnwindSafe diff --git a/crates/tor-hsclient/src/state.rs b/crates/tor-hsclient/src/state.rs index a9723fa7e..71459419b 100644 --- a/crates/tor-hsclient/src/state.rs +++ b/crates/tor-hsclient/src/state.rs @@ -402,14 +402,20 @@ fn obtain_circuit_or_continuation_info( let connect_future = async move { let mut data = data; - let got = - AssertUnwindSafe(D::connect(&connector, netdir, config, hsid, &mut data, secret_keys)) - .catch_unwind() - .await - .unwrap_or_else(|_| { - data = D::default(); - Err(internal!("hidden service connector task panicked!").into()) - }); + let got = AssertUnwindSafe(D::connect( + &connector, + netdir, + config, + hsid, + &mut data, + secret_keys, + )) + .catch_unwind() + .await + .unwrap_or_else(|_| { + data = D::default(); + Err(internal!("hidden service connector task panicked!").into()) + }); let now = connector.runtime.now(); let last_used = now;