Skip to content

Commit

Permalink
lint: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
prestwich committed Dec 24, 2024
1 parent 17a3ce7 commit c2e9705
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ impl<const BITS: usize, const LIMBS: usize> Uint<BITS, LIMBS> {
///
/// The number of bytes written to the buffer (always equal to
/// [`Self::BYTES`]), but often useful to make explicit for encoders).
#[inline]
pub fn copy_le_bytes_to(&self, buf: &mut [u8]) -> usize {
// This is debug only. Release panics occur later in copy_from_slice
debug_assert!(
Expand Down Expand Up @@ -385,6 +386,7 @@ impl<const BITS: usize, const LIMBS: usize> Uint<BITS, LIMBS> {
/// [`Some`] with the number of bytes written to the buffer (always
/// equal to [`Self::BYTES`]), but often useful to make explicit for
/// encoders.
#[inline]
pub fn checked_copy_le_bytes_to(&self, buf: &mut [u8]) -> Option<usize> {
if buf.len() < Self::BYTES {
return None;
Expand All @@ -404,6 +406,7 @@ impl<const BITS: usize, const LIMBS: usize> Uint<BITS, LIMBS> {
///
/// The number of bytes written to the buffer (always equal to
/// [`Self::BYTES`]), but often useful to make explicit for encoders).
#[inline]
pub fn copy_be_bytes_to(&self, buf: &mut [u8]) -> usize {
// This is debug only. Release panics occur later in copy_from_slice
debug_assert!(
Expand Down Expand Up @@ -434,6 +437,7 @@ impl<const BITS: usize, const LIMBS: usize> Uint<BITS, LIMBS> {
/// [`Some`] with the number of bytes written to the buffer (always
/// equal to [`Self::BYTES`]), but often useful to make explicit for
/// encoders.
#[inline]
pub fn checked_copy_be_bytes_to(&self, buf: &mut [u8]) -> Option<usize> {
if buf.len() < Self::BYTES {
return None;
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
)]

#[cfg(feature = "alloc")]
#[macro_use]
extern crate alloc;

#[macro_use]
Expand Down

0 comments on commit c2e9705

Please sign in to comment.