Skip to content

Commit 90f7392

Browse files
committed
fmt and fix io::Write impl
1 parent e52f095 commit 90f7392

File tree

5 files changed

+25
-12
lines changed

5 files changed

+25
-12
lines changed

digest/src/core_api.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
//! core algorithm wrapped by the wrapper types, which implement the
55
//! higher-level traits.
66
use crate::InvalidOutputSize;
7-
use generic_array::{ArrayLength, typenum::{U256, IsLess, Le, NonZero}};
7+
use generic_array::{
8+
typenum::{IsLess, Le, NonZero, U256},
9+
ArrayLength,
10+
};
811

912
pub use crypto_common::{AlgorithmName, Block, BlockSizeUser, OutputSizeUser, Reset};
1013

digest/src/core_api/ct_variable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::MacMarker;
77
use core::{fmt, marker::PhantomData};
88
use crypto_common::{Block, BlockSizeUser, OutputSizeUser};
99
use generic_array::{
10-
typenum::{IsLessOrEqual, IsLess, Le, LeEq, NonZero, U256},
10+
typenum::{IsLess, IsLessOrEqual, Le, LeEq, NonZero, U256},
1111
ArrayLength, GenericArray,
1212
};
1313

digest/src/core_api/rt_variable.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::MacMarker;
55
use crate::{InvalidOutputSize, Reset, Update, VariableOutput};
66
use block_buffer::BlockBuffer;
77
use core::fmt;
8-
use generic_array::typenum::{Unsigned, Le, IsLess, U256, NonZero};
8+
use generic_array::typenum::{IsLess, Le, NonZero, Unsigned, U256};
99

1010
/// Wrapper around [`VariableOutputCore`] which selects output size
1111
/// at run time.
@@ -26,7 +26,8 @@ where
2626
T: VariableOutputCore + HashMarker,
2727
T::BlockSize: IsLess<U256>,
2828
Le<T::BlockSize, U256>: NonZero,
29-
{}
29+
{
30+
}
3031

3132
#[cfg(feature = "mac")]
3233
#[cfg_attr(docsrs, doc(cfg(feature = "mac")))]
@@ -35,7 +36,8 @@ where
3536
T: VariableOutputCore + MacMarker,
3637
T::BlockSize: IsLess<U256>,
3738
Le<T::BlockSize, U256>: NonZero,
38-
{}
39+
{
40+
}
3941

4042
impl<T> Reset for RtVariableCoreWrapper<T>
4143
where

digest/src/core_api/wrapper.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use super::{
55
use crate::{ExtendableOutput, FixedOutput, FixedOutputReset, HashMarker, Update};
66
use block_buffer::BlockBuffer;
77
use core::fmt;
8-
use crypto_common::{InvalidLength, Key, KeyInit, KeySizeUser, Output, BlockSizeUser};
9-
use generic_array::typenum::{NonZero, IsLess, Le, U256};
8+
use crypto_common::{BlockSizeUser, InvalidLength, Key, KeyInit, KeySizeUser, Output};
9+
use generic_array::typenum::{IsLess, Le, NonZero, U256};
1010

1111
#[cfg(feature = "mac")]
1212
use crate::MacMarker;
@@ -30,7 +30,8 @@ where
3030
T: BufferKindUser + HashMarker,
3131
T::BlockSize: IsLess<U256>,
3232
Le<T::BlockSize, U256>: NonZero,
33-
{}
33+
{
34+
}
3435

3536
#[cfg(feature = "mac")]
3637
#[cfg_attr(docsrs, doc(cfg(feature = "mac")))]
@@ -39,7 +40,8 @@ where
3940
T: BufferKindUser + MacMarker,
4041
T::BlockSize: IsLess<U256>,
4142
Le<T::BlockSize, U256>: NonZero,
42-
{}
43+
{
44+
}
4345

4446
impl<T> CoreWrapper<T>
4547
where
@@ -196,7 +198,12 @@ where
196198

197199
#[cfg(feature = "std")]
198200
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
199-
impl<D: UpdateCore + BufferKindUser> std::io::Write for CoreWrapper<D> {
201+
impl<T> std::io::Write for CoreWrapper<T>
202+
where
203+
T: BufferKindUser + UpdateCore,
204+
T::BlockSize: IsLess<U256>,
205+
Le<T::BlockSize, U256>: NonZero,
206+
{
200207
#[inline]
201208
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
202209
Update::update(self, buf);
@@ -226,7 +233,8 @@ where
226233
T: BufferKindUser,
227234
T::BlockSize: IsLess<U256>,
228235
Le<T::BlockSize, U256>: NonZero,
229-
{}
236+
{
237+
}
230238

231239
impl<T> CoreProxy for CoreWrapper<T>
232240
where

digest/src/core_api/xof_reader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use super::{AlgorithmName, XofReaderCore};
22
use crate::XofReader;
33
use block_buffer::EagerBuffer;
44
use core::fmt;
5-
use generic_array::typenum::{IsLess, Le, U256, NonZero};
5+
use generic_array::typenum::{IsLess, Le, NonZero, U256};
66

77
/// Wrapper around [`XofReaderCore`] implementations.
88
///

0 commit comments

Comments
 (0)