Skip to content

Commit 7888b52

Browse files
committed
Code improvements suggested by Clippy 1.90.
1 parent 986b82e commit 7888b52

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/commons/crypto/signing/dispatch/signerrouter.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,7 @@ impl Signer for SignerRouter {
782782

783783
#[cfg(all(test, feature = "hsm"))]
784784
pub mod tests {
785+
use std::slice;
785786
use rpki::crypto::RpkiSignatureAlgorithm;
786787

787788
use crate::{
@@ -836,7 +837,7 @@ pub mod tests {
836837
// Create a SignerRouter that uses the mock signer with the mock
837838
// signer starting in the pending signer set.
838839
let router = create_signer_router(
839-
&[mock_signer.clone()],
840+
slice::from_ref(&mock_signer),
840841
signer_mapper.clone(),
841842
);
842843

@@ -901,7 +902,7 @@ pub mod tests {
901902
// forcing it to re-read it's saved state from disk
902903
// (and we're not trying to test the AggregateStore here anyway!).
903904
let router = create_signer_router(
904-
&[mock_signer.clone()],
905+
slice::from_ref(&mock_signer),
905906
signer_mapper.clone(),
906907
);
907908

src/commons/storage/test.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//! requires a wee bit of macro magic.
55
#![cfg(test)]
66

7+
use std::slice;
78
use std::sync::{Mutex, MutexGuard};
89
use lazy_static::lazy_static;
910
use tempfile::{TempDir, tempdir};
@@ -194,7 +195,7 @@ testfns! {
194195
assert!(store.scopes().unwrap().is_empty());
195196

196197
store.store(&key, &CONTENT).unwrap();
197-
assert_eq!(store.scopes().unwrap(), [scope.clone()]);
198+
assert_eq!(store.scopes().unwrap(), slice::from_ref(&scope));
198199

199200
store.store(&key2, &CONTENT_2).unwrap();
200201

@@ -205,7 +206,7 @@ testfns! {
205206
assert_eq!(scopes, expected);
206207

207208
store.drop_scope(&scope2).unwrap();
208-
assert_eq!(store.scopes().unwrap(), [scope.clone()]);
209+
assert_eq!(store.scopes().unwrap(), slice::from_ref(&scope));
209210

210211
store.drop_scope(&scope).unwrap();
211212
assert!(store.scopes().unwrap().is_empty());
@@ -247,7 +248,9 @@ testfns! {
247248
expected.sort();
248249
assert_eq!(keys, expected);
249250

250-
assert_eq!(store.keys(&scope, id2.as_str()).unwrap(), [key2.clone()]);
251+
assert_eq!(
252+
store.keys(&scope, id2.as_str()).unwrap(), slice::from_ref(&key2)
253+
);
251254
assert_eq!(store.keys(&scope, id3.as_str()).unwrap(), []);
252255
assert_eq!(
253256
store.keys(&Scope::global(), id3.as_str()).unwrap(),

0 commit comments

Comments
 (0)