mirror of
https://github.com/NLnetLabs/krill.git
synced 2026-09-13 04:57:43 +02:00
Fix clippy warnings under rust 1.41
This commit is contained in:
+1
-2
@@ -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<T: DeserializeOwned>(&self, uri: &str) -> Result<T, Error> {
|
||||
@@ -454,5 +454,4 @@ mod tests {
|
||||
_ => panic!("Expected body"),
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
})
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()?;
|
||||
|
||||
|
||||
@@ -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"))
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
+1
-1
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user