Skip to content

Commit

Permalink
Allow dead code for ParamBytes inner
Browse files Browse the repository at this point in the history
The code isn't actually dead, and is used in the bytes() function, but the
compiler's dead code analysis doesn't fully track usage through feature flags
and doesn't count if the pattern isn't considered a read of the field.
  • Loading branch information
DanGould committed Dec 2, 2024
1 parent 1f0d7b9 commit 263af9f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,15 @@ enum ParamInner<'a> {
/// The lifetime of this may be shorter than that of [`Param<'a>`].
#[cfg(feature = "non-compliant-bytes")]
#[cfg_attr(docsrs, doc(cfg(feature = "non-compliant-bytes")))]
#[cfg_attr(feature = "non-compliant-bytes", allow(dead_code))]
pub struct ParamBytes<'a>(ParamIterInner<'a, core::iter::Cloned<core::slice::Iter<'a, u8>>>);

/// Iterator over decoded bytes inside paramter.
///
/// The lifetime of this is same as that of [`Param<'a>`].
#[cfg(feature = "non-compliant-bytes")]
#[cfg_attr(docsrs, doc(cfg(feature = "non-compliant-bytes")))]
#[cfg_attr(feature = "non-compliant-bytes", allow(dead_code))]
pub struct ParamBytesOwned<'a>(ParamIterInner<'a, Either<core::iter::Cloned<core::slice::Iter<'a, u8>>, alloc::vec::IntoIter<u8>>>);

#[cfg(feature = "non-compliant-bytes")]
Expand Down

0 comments on commit 263af9f

Please sign in to comment.