Skip to content

Commit d79d548

Browse files
djcRalith
authored andcommitted
Style tweaks from #851
1 parent 82cc875 commit d79d548

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

quinn-proto/src/cid_generator.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ pub struct RandomConnectionIdGenerator {
2626
cid_len: usize,
2727
lifetime: Option<Duration>,
2828
}
29+
2930
impl Default for RandomConnectionIdGenerator {
3031
fn default() -> Self {
3132
Self {
@@ -34,8 +35,11 @@ impl Default for RandomConnectionIdGenerator {
3435
}
3536
}
3637
}
38+
3739
impl RandomConnectionIdGenerator {
38-
/// Initialize Random CID generator with a fixed CID length (which must be less or equal to MAX_CID_SIZE)
40+
/// Initialize Random CID generator with a fixed CID length
41+
///
42+
/// The given length must be less than or equal to MAX_CID_SIZE.
3943
pub fn new(cid_len: usize) -> Self {
4044
debug_assert!(cid_len <= MAX_CID_SIZE);
4145
Self {
@@ -50,6 +54,7 @@ impl RandomConnectionIdGenerator {
5054
self
5155
}
5256
}
57+
5358
impl ConnectionIdGenerator for RandomConnectionIdGenerator {
5459
fn generate_cid(&mut self) -> (ConnectionId, Option<Duration>) {
5560
let mut bytes_arr = [0; MAX_CID_SIZE];

quinn-proto/src/config.rs

+7-8
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,14 @@ where
324324

325325
/// Supply a custom connection ID generator factory
326326
///
327-
/// Called once by each `Endpoint` constructed from this configuration to obtain the CID generator which will
328-
/// be used to generate the CIDs used for incoming packets on all connections involving that `Endpoint`. A
329-
/// custom CID generator allows applications to embed information in local connection IDs, e.g. to support
330-
/// stateless packet-level load balancers.
327+
/// Called once by each `Endpoint` constructed from this configuration to obtain the CID
328+
/// generator which will be used to generate the CIDs used for incoming packets on all
329+
/// connections involving that `Endpoint`. A custom CID generator allows applications to embed
330+
/// information in local connection IDs, e.g. to support stateless packet-level load balancers.
331331
///
332-
///
333-
/// EndpointConfig::new() applies a default random CID generator factory.
334-
/// This functions accepts any customized CID generator to reset CID generator factory that
335-
/// implements ConnectionIdGenerator trait
332+
/// `EndpointConfig::new()` applies a default random CID generator factory. This functions
333+
/// accepts any customized CID generator to reset CID generator factory that implements
334+
/// the `ConnectionIdGenerator` trait.
336335
pub fn cid_generator<F: Fn() -> Box<dyn ConnectionIdGenerator> + Send + Sync + 'static>(
337336
&mut self,
338337
factory: F,

0 commit comments

Comments
 (0)