Skip to content

Commit d04d362

Browse files
committed
Fixes
1 parent dab3e57 commit d04d362

File tree

9 files changed

+22
-20
lines changed

9 files changed

+22
-20
lines changed

blobby/src/decode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pub const fn parse_into_array<const ITEMS_LEN: usize, const DEDUP_LEN: usize>(
136136
/// Parse blobby data into a vector of slices.
137137
///
138138
/// # Errors
139-
/// - if data failed to parse successfully
139+
/// If data failed to parse successfully
140140
#[cfg(feature = "alloc")]
141141
#[allow(clippy::missing_panics_doc, clippy::panic_in_result_fn)]
142142
pub fn parse_into_vec(mut data: &[u8]) -> Result<alloc::vec::Vec<&[u8]>, Error> {

block-buffer/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl<BS: ArraySize, K: BufferKind> BlockBuffer<BS, K> {
145145
/// Create new buffer from slice.
146146
///
147147
/// # Errors
148-
/// - if slice length is not valid for used buffer kind.
148+
/// If slice length is not valid for used buffer kind.
149149
#[inline(always)]
150150
pub fn try_new(buf: &[u8]) -> Result<Self, Error> {
151151
const {

block-padding/src/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub trait Padding: 'static {
2424
/// Unpad data in `block`.
2525
///
2626
/// # Errors
27-
/// - if the block contains malformed padding.
27+
/// If the block contains malformed padding.
2828
fn raw_unpad(block: &[u8]) -> Result<&[u8], Error>;
2929

3030
/// Pads `block` filled with data up to `pos` (i.e the message length
@@ -41,7 +41,7 @@ pub trait Padding: 'static {
4141
/// Unpad data in `block`.
4242
///
4343
/// # Errors
44-
/// - if the block contains malformed padding.
44+
/// If the block contains malformed padding.
4545
#[inline]
4646
fn unpad<BlockSize: ArraySize>(block: &Array<u8, BlockSize>) -> Result<&[u8], Error> {
4747
Self::raw_unpad(block.as_slice())
@@ -67,7 +67,7 @@ pub trait Padding: 'static {
6767
/// Unpad data in `blocks` and return unpadded byte slice.
6868
///
6969
/// # Errors
70-
/// - if `blocks` contain malformed padding.
70+
/// If `blocks` contain malformed padding.
7171
#[inline]
7272
#[allow(clippy::panic_in_result_fn)]
7373
fn unpad_blocks<BlockSize: ArraySize>(blocks: &[Array<u8, BlockSize>]) -> Result<&[u8], Error> {
@@ -184,11 +184,10 @@ impl Pkcs7 {
184184

185185
impl Padding for Pkcs7 {
186186
#[inline]
187-
#[allow(clippy::cast_possible_truncation)]
188187
fn raw_pad(block: &mut [u8], pos: usize) {
189188
assert!(block.len() <= 255, "block size is too big for PKCS#7");
190189
assert!(pos < block.len(), "`pos` is bigger or equal to block size");
191-
let n = (block.len() - pos) as u8;
190+
let n = u8::try_from(block.len() - pos).expect("overflow");
192191
block[pos..].fill(n);
193192
}
194193

cmov/tests/core_impls.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
//! Tests for `Cmov`/`CmovEq` impls on `core` types.
22
3-
#![allow(trivial_numeric_casts)]
3+
#![allow(
4+
trivial_numeric_casts,
5+
clippy::cast_possible_truncation,
6+
clippy::cast_sign_loss
7+
)]
48

59
/// Write the tests for an integer type, given two unequal integers
610
macro_rules! int_tests {

cpufeatures/src/aarch64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ macro_rules! check {
135135
/// <https://developer.apple.com/documentation/kernel/1387446-sysctlbyname>
136136
///
137137
/// # Panics
138-
/// - if `name` is not NUL terminated
138+
/// If `name` is not NUL terminated
139139
#[cfg(target_vendor = "apple")]
140140
#[must_use]
141141
pub unsafe fn sysctlbyname(name: &[u8]) -> bool {

inout/src/inout_buf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl<'inp, 'out, T> InOutBuf<'inp, 'out, T> {
6767
/// Create `InOutBuf` from immutable and mutable slices.
6868
///
6969
/// # Errors
70-
/// - if length of slices is not equal to each other.
70+
/// If length of slices is not equal to each other.
7171
#[inline(always)]
7272
pub fn new(in_buf: &'inp [T], out_buf: &'out mut [T]) -> Result<Self, NotEqualError> {
7373
if in_buf.len() != out_buf.len() {

inout/src/reserved.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl<'a, T> InOutBufReserved<'a, 'a, T> {
2424
/// Crate [`InOutBufReserved`] from a single mutable slice.
2525
///
2626
/// # Errors
27-
/// - if `out` is too small.
27+
/// If `out` is too small.
2828
pub fn from_mut_slice(buf: &'a mut [T], msg_len: usize) -> Result<Self, OutIsTooSmallError> {
2929
if msg_len > buf.len() {
3030
return Err(OutIsTooSmallError);
@@ -122,7 +122,7 @@ impl<'inp, 'out, T> InOutBufReserved<'inp, 'out, T> {
122122
/// Crate [`InOutBufReserved`] from two separate slices.
123123
///
124124
/// # Errors
125-
/// - if `out` is too small.
125+
/// If `out` is too small.
126126
pub fn from_slices(
127127
in_buf: &'inp [T],
128128
out_buf: &'out mut [T],
@@ -165,7 +165,7 @@ impl<'inp, 'out> InOutBufReserved<'inp, 'out, u8> {
165165
/// Transform buffer into [`PaddedInOutBuf`] using padding algorithm `P`.
166166
///
167167
/// # Errors
168-
/// - if the padding is invalid
168+
/// If the padding is invalid
169169
#[inline(always)]
170170
#[allow(clippy::missing_panics_doc, clippy::panic_in_result_fn)]
171171
pub fn into_padded_blocks<P, BS>(self) -> Result<PaddedInOutBuf<'inp, 'out, BS>, PadError>

wycheproof2blb/src/wycheproof.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Helpers for retrieving Wycheproof test vectors.
22
3+
use core::fmt;
34
use serde::Deserialize;
45

56
/// `Suite` represents the common elements of the top level object in a Wycheproof json
@@ -36,8 +37,8 @@ pub enum CaseResult {
3637
Acceptable,
3738
}
3839

39-
impl core::fmt::Display for CaseResult {
40-
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
40+
impl fmt::Display for CaseResult {
41+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4142
write!(
4243
f,
4344
"{}",

zeroize/tests/zeroize.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@
33
#![allow(
44
clippy::missing_safety_doc,
55
clippy::std_instead_of_alloc,
6-
clippy::std_instead_of_core,
7-
clippy::undocumented_unsafe_blocks,
8-
clippy::unwrap_used
6+
clippy::undocumented_unsafe_blocks
97
)]
108

11-
use std::{
9+
use core::{
1210
marker::{PhantomData, PhantomPinned},
1311
mem::{MaybeUninit, size_of},
1412
num::*,
15-
sync::Arc,
1613
};
14+
use std::sync::Arc;
1715
use zeroize::*;
1816

1917
#[cfg(feature = "std")]

0 commit comments

Comments
 (0)