Skip to content

Commit

Permalink
chore: add allow(clippy::needless_as_bytes) for some Clarity message …
Browse files Browse the repository at this point in the history
…codecs
  • Loading branch information
kantai committed Jan 10, 2025
1 parent f4db3c9 commit 430385e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clarity/src/vm/representations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ guarded_string!(
);

impl StacksMessageCodec for ClarityName {
#[allow(clippy::needless_as_bytes)] // as_bytes isn't necessary, but verbosity is preferable in the codec impls
fn consensus_serialize<W: Write>(&self, fd: &mut W) -> Result<(), codec_error> {
// ClarityName can't be longer than vm::representations::MAX_STRING_LEN, which itself is
// a u8, so we should be good here.
Expand Down Expand Up @@ -124,6 +125,7 @@ impl StacksMessageCodec for ClarityName {
}

impl StacksMessageCodec for ContractName {
#[allow(clippy::needless_as_bytes)] // as_bytes isn't necessary, but verbosity is preferable in the codec impls
fn consensus_serialize<W: Write>(&self, fd: &mut W) -> Result<(), codec_error> {
if self.as_bytes().len() < CONTRACT_MIN_NAME_LENGTH
|| self.as_bytes().len() > CONTRACT_MAX_NAME_LENGTH
Expand Down

0 comments on commit 430385e

Please sign in to comment.