Skip to content

Commit

Permalink
remove unneeded mut
Browse files Browse the repository at this point in the history
  • Loading branch information
cowlicks committed Oct 28, 2024
1 parent 929804d commit 78a335e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/channels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ impl ChannelMap {
}
}

pub(crate) fn has_channel(&mut self, discovery_key: &[u8]) -> bool {
pub(crate) fn has_channel(&self, discovery_key: &[u8]) -> bool {
let hdkey = hex::encode(discovery_key);
self.channels.contains_key(&hdkey)
}
Expand Down
4 changes: 2 additions & 2 deletions src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ impl Message {
}

/// Pre-encodes a message to state, returns length
pub(crate) fn preencode(&mut self, state: &mut HypercoreState) -> Result<usize, EncodingError> {
pub(crate) fn preencode(&self, state: &mut HypercoreState) -> Result<usize, EncodingError> {
match self {
Self::Open(ref message) => state.0.preencode(message)?,
Self::Close(ref message) => state.0.preencode(message)?,
Expand All @@ -427,7 +427,7 @@ impl Message {

/// Encodes a message to a given buffer, using preencoded state, results size
pub(crate) fn encode(
&mut self,
&self,
state: &mut HypercoreState,
buf: &mut [u8],
) -> Result<usize, EncodingError> {
Expand Down

0 comments on commit 78a335e

Please sign in to comment.