diff --git a/src/cli/client.rs b/src/cli/client.rs index 2f9c9bde..b7668c28 100644 --- a/src/cli/client.rs +++ b/src/cli/client.rs @@ -329,7 +329,7 @@ impl KrillClient { let c: Config = toml::from_slice(config.as_ref()).map_err(Error::init)?; c.verify().map_err(Error::init)?; - Ok(ApiResponse::GenericBody(config.to_string())) + Ok(ApiResponse::GenericBody(config)) } fn get_json(&self, uri: &str) -> Result { @@ -454,5 +454,4 @@ mod tests { _ => panic!("Expected body"), } } - } diff --git a/src/commons/error.rs b/src/commons/error.rs index 5426885a..b6422156 100644 --- a/src/commons/error.rs +++ b/src/commons/error.rs @@ -617,7 +617,7 @@ mod tests { ); verify( include_str!("../../test-resources/errors/pub-duplicate.json"), - Error::PublisherDuplicate(publisher.clone()), + Error::PublisherDuplicate(publisher), ); verify( include_str!("../../test-resources/errors/pub-outside-jail.json"), @@ -696,7 +696,7 @@ mod tests { ); verify( include_str!("../../test-resources/errors/ca-parent-issue.json"), - Error::CaParentIssue(ca.clone(), parent.clone(), "connection refused".to_string()), + Error::CaParentIssue(ca.clone(), parent, "connection refused".to_string()), ); verify( include_str!("../../test-resources/errors/ca-parent-response-invalid-xml.json"), @@ -734,7 +734,7 @@ mod tests { ); verify( include_str!("../../test-resources/errors/ca-child-unauthorised.json"), - Error::CaChildUnauthorised(ca.clone(), child.clone()), + Error::CaChildUnauthorised(ca.clone(), child), ); verify( @@ -751,7 +751,7 @@ mod tests { ); verify( include_str!("../../test-resources/errors/ca-roa-not-entitled.json"), - Error::CaAuthorisationNotEntitled(ca.clone(), auth), + Error::CaAuthorisationNotEntitled(ca, auth), ); verify( @@ -823,5 +823,4 @@ mod tests { // file::save_json(&error_response, &path).unwrap(); // } } - } diff --git a/src/commons/eventsourcing/mod.rs b/src/commons/eventsourcing/mod.rs index 5cdf810a..250ecf94 100644 --- a/src/commons/eventsourcing/mod.rs +++ b/src/commons/eventsourcing/mod.rs @@ -203,9 +203,6 @@ mod tests { pub fn id(&self) -> &Handle { &self.id } - pub fn version(&self) -> u64 { - self.version - } pub fn name(&self) -> &String { &self.name } @@ -335,5 +332,4 @@ mod tests { assert_eq!(history.to_string().as_str(), expected_history); }) } - } diff --git a/src/daemon/ca/server.rs b/src/daemon/ca/server.rs index 73ec2652..89b98770 100644 --- a/src/daemon/ca/server.rs +++ b/src/daemon/ca/server.rs @@ -999,9 +999,7 @@ mod tests { assert!(server.get_trust_anchor().is_err()); - server - .init_ta(repo_info.clone(), ta_aia, vec![ta_uri]) - .unwrap(); + server.init_ta(repo_info, ta_aia, vec![ta_uri]).unwrap(); assert!(server.get_trust_anchor().is_ok()); }) diff --git a/src/daemon/ca/signing.rs b/src/daemon/ca/signing.rs index 344eaa4b..410d49c0 100644 --- a/src/daemon/ca/signing.rs +++ b/src/daemon/ca/signing.rs @@ -195,13 +195,7 @@ impl SignSupport { .map_err(ca::Error::signer)?; let cert_uri = signing_cert.uri_for_object(&cert); - Ok(IssuedCert::new( - cert_uri, - limit, - resources.clone(), - cert, - replaces, - )) + Ok(IssuedCert::new(cert_uri, limit, resources, cert, replaces)) } /// Returns a validity period from 5 minutes ago (in case of NTP mess-up), to diff --git a/src/daemon/krillserver.rs b/src/daemon/krillserver.rs index b349f108..f14d8966 100644 --- a/src/daemon/krillserver.rs +++ b/src/daemon/krillserver.rs @@ -130,7 +130,7 @@ impl KrillServer { let ta_aia = uri::Rsync::from_string(ta_aia).unwrap(); // Add TA - caserver.init_ta(repo_info.clone(), ta_aia, vec![ta_uri])?; + caserver.init_ta(repo_info, ta_aia, vec![ta_uri])?; let ta = caserver.get_trust_anchor()?; diff --git a/src/pubd/pubserver.rs b/src/pubd/pubserver.rs index 6b62beb5..fcbba32e 100644 --- a/src/pubd/pubserver.rs +++ b/src/pubd/pubserver.rs @@ -511,7 +511,7 @@ mod tests { builder.add_publish(file3.as_publish()); let delta = builder.finish(); - match server.publish(alice_handle.clone(), delta) { + match server.publish(alice_handle, delta) { Err(Error::Rfc8181Delta(PublicationDeltaError::ObjectAlreadyPresent(uri))) => { assert_eq!(uri, test::rsync("rsync://localhost/repo/alice/file3.txt")) } diff --git a/tests/ca_grandchildren.rs b/tests/ca_grandchildren.rs index 1c95e645..e21eed7a 100644 --- a/tests/ca_grandchildren.rs +++ b/tests/ca_grandchildren.rs @@ -111,7 +111,7 @@ fn ca_grandchildren() { let ca_3_res = ca_3_res_under_ca_1.union(&ca_3_res_under_ca_2); let req = child_request(&ca3); let parent = { - let contact = add_child_rfc6492(&ca2, &ca3, req, ca_3_res_under_ca_2.clone()); + let contact = add_child_rfc6492(&ca2, &ca3, req, ca_3_res_under_ca_2); ParentCaReq::new(ca2.clone(), contact) }; add_parent_to_ca(&ca3, parent); diff --git a/tests/ca_keyroll_rfc6492.rs b/tests/ca_keyroll_rfc6492.rs index 360fa753..b8e1cb99 100644 --- a/tests/ca_keyroll_rfc6492.rs +++ b/tests/ca_keyroll_rfc6492.rs @@ -18,7 +18,7 @@ fn ca_keyroll_rfc6492() { // RFC6492 parent -------------------------------------------------------------------- let parent = { let contact = add_child_to_ta_rfc6492(&child, req, child_resources.clone()); - ParentCaReq::new(ta_handle.clone(), contact) + ParentCaReq::new(ta_handle, contact) }; add_parent_to_ca(&child, parent); diff --git a/tests/ca_rfc6492.rs b/tests/ca_rfc6492.rs index e160e25a..404349d5 100644 --- a/tests/ca_rfc6492.rs +++ b/tests/ca_rfc6492.rs @@ -76,7 +76,7 @@ fn ca_rfc6492() { let parent = { let req = child_request(&child); let contact = add_child_to_ta_rfc6492(&child, req, child_resources.clone()); - ParentCaReq::new(ta_handle.clone(), contact) + ParentCaReq::new(ta_handle, contact) }; // And can add the parent back to the child, and it will request resources again. diff --git a/tests/ca_roas.rs b/tests/ca_roas.rs index c04efccd..cf2a7681 100644 --- a/tests/ca_roas.rs +++ b/tests/ca_roas.rs @@ -39,7 +39,7 @@ fn ca_roas() { let mft_file = ".mft"; let route1_file = ObjectName::from(&route_1).to_string(); let route1_file = route1_file.as_str(); - let route2_file = ObjectName::from(&route_2).to_string();; + let route2_file = ObjectName::from(&route_2).to_string(); let route2_file = route2_file.as_str(); let route3_file = ObjectName::from(&route_3).to_string(); let route3_file = route3_file.as_str(); diff --git a/tests/remote_publication.rs b/tests/remote_publication.rs index 2a5d984d..3dc8b9ba 100644 --- a/tests/remote_publication.rs +++ b/tests/remote_publication.rs @@ -95,7 +95,7 @@ fn remote_publication() { let parent = { let parent_contact = add_child_to_ta_embedded(&child, child_resources.clone()); - ParentCaReq::new(ta_handle.clone(), parent_contact) + ParentCaReq::new(ta_handle, parent_contact) }; add_parent_to_ca(&child, parent);