Skip to content

Commit

Permalink
fix: fix all clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
max-niederman committed Jan 17, 2024
1 parent f4a7546 commit 2dfbaea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/centipede_proto/src/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,13 @@ impl Message<auth::Valid> {
_auth: PhantomData::<auth::Valid>,
}),
Err(e) => Err(ValidateError {
message: Message {
message: Box::new(Message {
sender,
signature,
sequence_number,
content,
_auth: PhantomData::<auth::Invalid>,
},
}),
reason: e,
}
.into()),
Expand Down Expand Up @@ -271,7 +271,7 @@ pub enum ParseError {
#[derive(Debug, Error)]
#[error("failed to validate control message: {message:?}")]
pub struct ValidateError {
pub message: Message<auth::Invalid>,
pub message: Box<Message<auth::Invalid>>,

#[source]
pub reason: ed25519_dalek::SignatureError,
Expand Down
5 changes: 4 additions & 1 deletion packages/centipede_proto/src/packet.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::{
fmt::Debug,
io,
marker::PhantomData,
ops::{Deref, DerefMut, Range, RangeFrom},
};
Expand Down Expand Up @@ -55,6 +54,8 @@ where

/// Attest that the message is valid, without validating its signature.
///
/// # Safety
/// The packet must satisfy the invariants of the authentication status and text kind.
/// This function should be treated with the utmost caution.
pub unsafe fn attest(self) -> Message<B, auth::Valid, T> {
Message {
Expand All @@ -75,6 +76,8 @@ where

/// Create a message from a buffer without validating its structure or authenticity.
///
/// # Safety
/// The buffer must satisfy the invariants of the authentication status and text kind.
/// This function should be treated with the utmost caution.
pub const unsafe fn from_buffer_unchecked(buffer: B) -> Self {
Self {
Expand Down
2 changes: 1 addition & 1 deletion packages/centipede_router/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ mod tests {
Router::new([0; 8]);
}

fn state<'c>(controller: &Controller) -> Arc<ConfiguredRouter> {
fn state(controller: &Controller) -> Arc<ConfiguredRouter> {
controller.router.state.load_full()
}

Expand Down

0 comments on commit 2dfbaea

Please sign in to comment.