Skip to content

Commit b03d6f9

Browse files
committed
rustfmt
1 parent 89f44fc commit b03d6f9

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
use bouncycastle_core::errors::CoreError;
2-
use bouncycastle_core::serializable_state::{LIB_VERSION};
3-
use bouncycastle_core::traits::{SerializableState};
2+
use bouncycastle_core::serializable_state::LIB_VERSION;
3+
use bouncycastle_core::traits::SerializableState;
44

5-
pub struct TestFrameworkSerializableState { }
5+
pub struct TestFrameworkSerializableState {}
66

77
impl TestFrameworkSerializableState {
88
pub fn new() -> Self {
9-
Self { }
9+
Self {}
1010
}
1111

1212
/// Test all the members of trait SerializableState.
13-
///
13+
///
1414
/// Expects ta be handed an instance of the object that has some in-progress state to be serialized.
1515
pub fn test<const SERIALIZED_STATE_LEN: usize, S: SerializableState<SERIALIZED_STATE_LEN>>(
1616
&self,
1717
instance: &S,
1818
) {
1919
// There's not a lot we can test here in the abstract, but we can test a few things to
2020
// ensure that the SerializableState trait has been impl'd correctly.
21-
21+
2222
// You can serialize and then deserialize the state.
2323
let serialized_state = instance.serialize_state();
2424
assert_eq!(serialized_state.len(), SERIALIZED_STATE_LEN);
25-
25+
2626
let _deserialized_state = S::from_serialized_state(serialized_state).unwrap();
27-
28-
27+
2928
// The serialized state MUST include a prefix indicating the current version of the library.
3029
assert_eq!(serialized_state[..3], LIB_VERSION);
31-
32-
30+
3331
// All implementations MUST reject a serialized state from lib ver 0.0.0
3432
// This doesn't really serve any purpose except testing that all impl's have properly
3533
// used the helper functions.
3634
let mut busted_serialized_state = serialized_state.clone();
3735
busted_serialized_state[..3].copy_from_slice(&[0, 0, 0]);
3836
match S::from_serialized_state(busted_serialized_state) {
39-
Err(CoreError::IncompatibleVersion) => { /* good */ },
40-
_ => { panic!("Expected IncompatibleVersion error") }
37+
Err(CoreError::IncompatibleVersion) => { /* good */ }
38+
_ => {
39+
panic!("Expected IncompatibleVersion error")
40+
}
4141
}
4242
}
4343
}

crypto/sha2/src/sha512.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{SHA2Params};
1+
use crate::SHA2Params;
22
use bouncycastle_core::errors::{CoreError, HashError};
33
use bouncycastle_core::serializable_state::{add_lib_ver, check_lib_ver};
44
use bouncycastle_core::traits::{Hash, SecurityStrength, SerializableState};

0 commit comments

Comments
 (0)