Skip to content
Snippets Groups Projects
Commit 949e5395 authored by Ian Jackson's avatar Ian Jackson
Browse files

Rename ChannelsParams types to ChannelPaddingInstructions (fmt)

Run rustfmt; no other changes.
parent 94dd3361
No related branches found
No related tags found
No related merge requests found
......@@ -251,7 +251,10 @@ impl crate::mgr::AbstractChannel for tor_proto::channel::Channel {
fn duration_unused(&self) -> Option<Duration> {
self.duration_unused()
}
fn reparameterize(&mut self, updates: Arc<ChannelPaddingInstructionsUpdates>) -> tor_proto::Result<()> {
fn reparameterize(
&mut self,
updates: Arc<ChannelPaddingInstructionsUpdates>,
) -> tor_proto::Result<()> {
self.reparameterize(updates)
}
fn engage_padding_activities(&self) {
......
......@@ -39,7 +39,10 @@ pub(crate) trait AbstractChannel: Clone {
///
/// The changed parameters may not be implemented "immediately",
/// but this will be done "reasonably soon".
fn reparameterize(&mut self, updates: Arc<ChannelPaddingInstructionsUpdates>) -> tor_proto::Result<()>;
fn reparameterize(
&mut self,
updates: Arc<ChannelPaddingInstructionsUpdates>,
) -> tor_proto::Result<()>;
/// Specify that this channel should do activities related to channel padding
///
......@@ -389,7 +392,10 @@ mod test {
fn duration_unused(&self) -> Option<Duration> {
None
}
fn reparameterize(&mut self, updates: Arc<ChannelPaddingInstructionsUpdates>) -> tor_proto::Result<()> {
fn reparameterize(
&mut self,
updates: Arc<ChannelPaddingInstructionsUpdates>,
) -> tor_proto::Result<()> {
self.last_params = Some((*updates).clone());
Ok(())
}
......
......@@ -18,7 +18,7 @@ use tor_proto::channel::ChannelPaddingInstructionsUpdates;
use tor_proto::ChannelPaddingInstructions;
use tor_units::{BoundedInt32, IntegerMilliseconds};
use tracing::info;
use void::{Void, ResultVoidExt as _};
use void::{ResultVoidExt as _, Void};
#[cfg(test)]
mod padding_test;
......@@ -168,7 +168,7 @@ impl NetParamsExtract {
/// Internal function.
fn pad_get(&self, reduced: bool, low_or_high: usize) -> IntegerMilliseconds<u32> {
self.nf_ito[usize::from(reduced)][low_or_high]
.try_map(|v| Ok::<_,Void>(v.into()))
.try_map(|v| Ok::<_, Void>(v.into()))
.void_unwrap()
}
}
......@@ -601,7 +601,10 @@ mod test {
fn duration_unused(&self) -> Option<Duration> {
self.unused_duration.map(Duration::from_secs)
}
fn reparameterize(&mut self, update: Arc<ChannelPaddingInstructionsUpdates>) -> tor_proto::Result<()> {
fn reparameterize(
&mut self,
update: Arc<ChannelPaddingInstructionsUpdates>,
) -> tor_proto::Result<()> {
self.params_update = Some(update);
Ok(())
}
......
......@@ -208,7 +208,10 @@ impl ChannelPaddingInstructions {
impl<'c> Drop for ChannelPaddingInstructionsUpdatesBuilder<'c> {
fn drop(&mut self) {
assert!(!self.drop_bomb, "ChannelPaddingInstructionsUpdatesBuilder dropped");
assert!(
!self.drop_bomb,
"ChannelPaddingInstructionsUpdatesBuilder dropped"
);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment