summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/arti-rpc-client-core/src/conn/auth.rs1
-rw-r--r--crates/arti-rpcserver/src/session.rs1
-rw-r--r--crates/arti/src/subcommands/hsc.rs2
-rw-r--r--crates/arti/src/subcommands/hss.rs4
-rw-r--r--crates/arti/src/subcommands/keys.rs1
-rw-r--r--crates/arti/src/subcommands/raw.rs1
-rw-r--r--crates/tor-cell/src/relaycell/extend.rs2
-rw-r--r--crates/tor-circmgr/src/impls.rs4
-rw-r--r--crates/tor-circmgr/src/mgr.rs1
-rw-r--r--crates/tor-dirmgr/src/storage/sqlite.rs10
-rw-r--r--crates/tor-linkspec/src/decode.rs5
-rw-r--r--crates/tor-netdoc/src/doc/hsdesc/build/inner.rs1
-rw-r--r--crates/tor-netdoc/src/doc/hsdesc/inner.rs5
-rw-r--r--crates/tor-proto/src/channel/circmap.rs4
-rw-r--r--crates/tor-proto/src/client/circuit.rs5
-rw-r--r--crates/tor-proto/src/client/reactor/conflux.rs5
-rw-r--r--crates/tor-proto/src/util/err.rs1
-rw-r--r--crates/tor-rpc-connect/src/connpt.rs1
-rw-r--r--crates/tor-rpc-connect/src/load.rs2
19 files changed, 48 insertions, 8 deletions
diff --git a/crates/arti-rpc-client-core/src/conn/auth.rs b/crates/arti-rpc-client-core/src/conn/auth.rs
index 4bcf4fe58..cbcf6ebe7 100644
--- a/crates/arti-rpc-client-core/src/conn/auth.rs
+++ b/crates/arti-rpc-client-core/src/conn/auth.rs
@@ -27,6 +27,7 @@ struct CookieBeginParams {
client_nonce: CookieAuthNonce,
}
+/// Response to an `auth:cookie_begin` request.
#[derive(Deserialize, Debug)]
struct CookieBeginReply {
/// Temporary ID to use while authenticating.
diff --git a/crates/arti-rpcserver/src/session.rs b/crates/arti-rpcserver/src/session.rs
index f5ccb98dd..44b38fee1 100644
--- a/crates/arti-rpcserver/src/session.rs
+++ b/crates/arti-rpcserver/src/session.rs
@@ -162,6 +162,7 @@ static_rpc_invoke_fn! {
}
#[cfg(feature = "describe-methods")]
+#[allow(clippy::missing_docs_in_private_items)] // TODO
mod list_all_methods {
use std::{convert::Infallible, sync::Arc};
diff --git a/crates/arti/src/subcommands/hsc.rs b/crates/arti/src/subcommands/hsc.rs
index f988c0a47..3a499cdc8 100644
--- a/crates/arti/src/subcommands/hsc.rs
+++ b/crates/arti/src/subcommands/hsc.rs
@@ -28,6 +28,7 @@ pub(crate) enum HscSubcommands {
Hsc(HscSubcommand),
}
+/// The `hsc` subcommand.
#[derive(Debug, Subcommand)]
pub(crate) enum HscSubcommand {
/// Prepare a service discovery key for connecting
@@ -49,6 +50,7 @@ pub(crate) enum HscSubcommand {
CTorMigrate(CTorMigrateArgs),
}
+/// The `hsc-key` subcommand.
#[derive(Debug, Subcommand)]
pub(crate) enum KeySubcommand {
/// Get or generate a hidden service client key
diff --git a/crates/arti/src/subcommands/hss.rs b/crates/arti/src/subcommands/hss.rs
index f7b95f883..a5842fda7 100644
--- a/crates/arti/src/subcommands/hss.rs
+++ b/crates/arti/src/subcommands/hss.rs
@@ -25,17 +25,19 @@ pub(crate) enum HssSubcommands {
Hss(Hss),
}
+/// The `hss` subcommand and args.
#[derive(Debug, Parser)]
pub(crate) struct Hss {
/// Arguments shared by all hss subcommands.
#[command(flatten)]
common: CommonArgs,
- /// Return the identity key for the specified service.
+ /// The `hss` subcommand to run.
#[command(subcommand)]
command: HssSubcommand,
}
+/// The `hss` subcommand.
#[derive(Subcommand, Debug, Clone)]
pub(crate) enum HssSubcommand {
/// Print the .onion address of a hidden service
diff --git a/crates/arti/src/subcommands/keys.rs b/crates/arti/src/subcommands/keys.rs
index 677086182..eaf6d043e 100644
--- a/crates/arti/src/subcommands/keys.rs
+++ b/crates/arti/src/subcommands/keys.rs
@@ -33,6 +33,7 @@ pub(crate) enum KeysSubcommands {
Keys(KeysSubcommand),
}
+/// The `keys` subcommand.
#[derive(Subcommand, Debug, Clone)]
pub(crate) enum KeysSubcommand {
/// List keys and certificates.
diff --git a/crates/arti/src/subcommands/raw.rs b/crates/arti/src/subcommands/raw.rs
index d2fd30273..943bbd320 100644
--- a/crates/arti/src/subcommands/raw.rs
+++ b/crates/arti/src/subcommands/raw.rs
@@ -17,6 +17,7 @@ pub(crate) enum RawSubcommands {
KeysRaw(RawSubcommand),
}
+/// The `keys-raw` subcommand.
#[derive(Subcommand, Debug, Clone)]
pub(crate) enum RawSubcommand {
/// Remove keystore entry by raw ID.
diff --git a/crates/tor-cell/src/relaycell/extend.rs b/crates/tor-cell/src/relaycell/extend.rs
index 981a8b049..cacf7ad70 100644
--- a/crates/tor-cell/src/relaycell/extend.rs
+++ b/crates/tor-cell/src/relaycell/extend.rs
@@ -183,6 +183,8 @@ decl_extension_group! {
}
}
+/// Helper for generating encoding and decoding functions
+/// for [`CircRequestExt`] and [`CircResponseExt`].
macro_rules! impl_encode_decode {
($extgroup:ty, $name:expr) => {
impl $extgroup {
diff --git a/crates/tor-circmgr/src/impls.rs b/crates/tor-circmgr/src/impls.rs
index b7c0fbc1c..01a046e8f 100644
--- a/crates/tor-circmgr/src/impls.rs
+++ b/crates/tor-circmgr/src/impls.rs
@@ -32,6 +32,10 @@ impl mgr::AbstractTunnel for tor_proto::ClientTunnel {
!self.is_closing()
}
+ // TODO: replace Itertools::exactly_one() with a stdlib equivalent when there is one.
+ //
+ // See issue #48919 <https://github.com/rust-lang/rust/issues/48919>
+ #[allow(unstable_name_collisions)]
fn single_path(&self) -> tor_proto::Result<Arc<Path>> {
use itertools::Itertools as _;
diff --git a/crates/tor-circmgr/src/mgr.rs b/crates/tor-circmgr/src/mgr.rs
index ff27c83a0..4c18b3248 100644
--- a/crates/tor-circmgr/src/mgr.rs
+++ b/crates/tor-circmgr/src/mgr.rs
@@ -65,6 +65,7 @@ pub(crate) enum TunnelProvenance {
Preexisting,
}
+/// An error returned when we cannot apply circuit restriction.
#[derive(Clone, Debug, thiserror::Error)]
#[non_exhaustive]
pub enum RestrictionFailed {
diff --git a/crates/tor-dirmgr/src/storage/sqlite.rs b/crates/tor-dirmgr/src/storage/sqlite.rs
index 398ff4d04..1011ea33e 100644
--- a/crates/tor-dirmgr/src/storage/sqlite.rs
+++ b/crates/tor-dirmgr/src/storage/sqlite.rs
@@ -538,7 +538,11 @@ impl Store for SqliteStore {
}
}
fn upgrade_to_readwrite(&mut self) -> Result<bool> {
- if self.is_readonly() && self.sql_path.is_some() {
+ let Some(sql_path) = self.sql_path.as_ref() else {
+ return Ok(true);
+ };
+
+ if self.is_readonly() {
let lf = self
.lockfile
.as_mut()
@@ -547,9 +551,7 @@ impl Store for SqliteStore {
// Somebody else has the lock.
return Ok(false);
}
- // Unwrap should be safe due to parent `.is_some()` check
- #[allow(clippy::unwrap_used)]
- match rusqlite::Connection::open(self.sql_path.as_ref().unwrap()) {
+ match rusqlite::Connection::open(sql_path) {
Ok(conn) => {
self.conn = conn;
}
diff --git a/crates/tor-linkspec/src/decode.rs b/crates/tor-linkspec/src/decode.rs
index 7919ee6d3..0bf658865 100644
--- a/crates/tor-linkspec/src/decode.rs
+++ b/crates/tor-linkspec/src/decode.rs
@@ -30,6 +30,11 @@ pub enum Strictness {
impl OwnedChanTargetBuilder {
/// Construct an [`OwnedChanTargetBuilder`] from a list of [`LinkSpec`],
/// validating it according to a given level of [`Strictness`].
+ ///
+ // TODO: replace Itertools::exactly_one() with a stdlib equivalent when there is one.
+ //
+ // See issue #48919 <https://github.com/rust-lang/rust/issues/48919>
+ #[allow(unstable_name_collisions)]
pub fn from_linkspecs(
strictness: Strictness,
linkspecs: &[LinkSpec],
diff --git a/crates/tor-netdoc/src/doc/hsdesc/build/inner.rs b/crates/tor-netdoc/src/doc/hsdesc/build/inner.rs
index a30b7b326..de59401b9 100644
--- a/crates/tor-netdoc/src/doc/hsdesc/build/inner.rs
+++ b/crates/tor-netdoc/src/doc/hsdesc/build/inner.rs
@@ -54,6 +54,7 @@ pub(super) struct HsDescInner<'a> {
pub(super) pow_params: Option<&'a PowParams>,
}
+/// Encode the pow-params line.
#[cfg(feature = "hs-pow-full")]
fn encode_pow_params(
encoder: &mut NetdocEncoder,
diff --git a/crates/tor-netdoc/src/doc/hsdesc/inner.rs b/crates/tor-netdoc/src/doc/hsdesc/inner.rs
index d4308889f..f2919471f 100644
--- a/crates/tor-netdoc/src/doc/hsdesc/inner.rs
+++ b/crates/tor-netdoc/src/doc/hsdesc/inner.rs
@@ -204,6 +204,11 @@ impl HsDescInner {
///
/// On success, return the signing key that was used for every certificate in the
/// inner document, and the inner document itself.
+ //
+ // TODO: replace Itertools::exactly_one() with a stdlib equivalent when there is one.
+ //
+ // See issue #48919 <https://github.com/rust-lang/rust/issues/48919>
+ #[allow(unstable_name_collisions)]
fn take_from_reader(
input: &mut NetDocReader<'_, HsInnerKwd>,
) -> Result<(Option<Ed25519Identity>, UncheckedHsDescInner)> {
diff --git a/crates/tor-proto/src/channel/circmap.rs b/crates/tor-proto/src/channel/circmap.rs
index 9d039d917..2361eba53 100644
--- a/crates/tor-proto/src/channel/circmap.rs
+++ b/crates/tor-proto/src/channel/circmap.rs
@@ -68,7 +68,7 @@ pub(super) enum CircEnt {
/// A sink which should receive all the relay cells for this circuit
/// from this channel
cell_sender: CircuitRxSender,
- //// A padding controller we should use when reporting flushed cells.
+ /// A padding controller we should use when reporting flushed cells.
padding_ctrl: PaddingController,
},
@@ -77,7 +77,7 @@ pub(super) enum CircEnt {
/// A sink which should receive all the relay cells for this circuit
/// from this channel
cell_sender: CircuitRxSender,
- //// A padding controller we should use when reporting flushed cells.
+ /// A padding controller we should use when reporting flushed cells.
padding_ctrl: PaddingController,
},
diff --git a/crates/tor-proto/src/client/circuit.rs b/crates/tor-proto/src/client/circuit.rs
index 667eaa06d..c686499a1 100644
--- a/crates/tor-proto/src/client/circuit.rs
+++ b/crates/tor-proto/src/client/circuit.rs
@@ -227,6 +227,11 @@ impl TunnelMutableState {
/// Return a list of [`Path`] objects describing the only circuit in this tunnel.
///
/// Returns an error if the tunnel has more than one tunnel.
+ //
+ // TODO: replace Itertools::exactly_one() with a stdlib equivalent when there is one.
+ //
+ // See issue #48919 <https://github.com/rust-lang/rust/issues/48919>
+ #[allow(unstable_name_collisions)]
fn single_path(&self) -> Result<Arc<Path>> {
use itertools::Itertools as _;
diff --git a/crates/tor-proto/src/client/reactor/conflux.rs b/crates/tor-proto/src/client/reactor/conflux.rs
index 6964f7810..f2eaa2752 100644
--- a/crates/tor-proto/src/client/reactor/conflux.rs
+++ b/crates/tor-proto/src/client/reactor/conflux.rs
@@ -1,5 +1,10 @@
//! Conflux-related functionality
+// TODO: replace Itertools::exactly_one() with a stdlib equivalent when there is one.
+//
+// See issue #48919 <https://github.com/rust-lang/rust/issues/48919>
+#![allow(unstable_name_collisions)]
+
#[cfg(feature = "conflux")]
pub(crate) mod msghandler;
diff --git a/crates/tor-proto/src/util/err.rs b/crates/tor-proto/src/util/err.rs
index b1351aa09..40a9d95ac 100644
--- a/crates/tor-proto/src/util/err.rs
+++ b/crates/tor-proto/src/util/err.rs
@@ -382,6 +382,7 @@ pub(crate) enum ConfluxHandshakeError {
ChannelClosed,
}
+/// An error returned when we receive excessive or unexpected padding.
#[derive(Debug, Clone, Error)]
#[non_exhaustive]
pub enum ExcessPadding {
diff --git a/crates/tor-rpc-connect/src/connpt.rs b/crates/tor-rpc-connect/src/connpt.rs
index 0f56714fa..c8eb33e8a 100644
--- a/crates/tor-rpc-connect/src/connpt.rs
+++ b/crates/tor-rpc-connect/src/connpt.rs
@@ -218,6 +218,7 @@ pub(crate) enum BuiltinVariant {
#[derive(Deserialize, Clone, Debug)]
#[serde(bound = "R::Path : Deserialize<'de>, AddrWithStr<R::SocketAddr> : Deserialize<'de>")]
+#[allow(clippy::missing_docs_in_private_items)]
pub(crate) struct Connect<R: Addresses> {
/// The address of the socket at which the client should try to reach the RPC server,
/// and which the RPC server should bind.
diff --git a/crates/tor-rpc-connect/src/load.rs b/crates/tor-rpc-connect/src/load.rs
index 0aa0b5f78..564fa8025 100644
--- a/crates/tor-rpc-connect/src/load.rs
+++ b/crates/tor-rpc-connect/src/load.rs
@@ -88,7 +88,7 @@ pub struct ConnPointIterator<'a> {
/// (We compute the `PathBuf`s in advance,
/// since every call to `DirEntry::file_name()` allocates a string).
entries: Vec<(PathBuf, fs::DirEntry)>,
- //// The `Options` map passed to `load_dir`.
+ /// The `Options` map passed to `load_dir`.
options: &'a HashMap<PathBuf, LoadOptions>,
}