summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko <heiko@schaefer.name>2021-05-18 15:22:50 +0200
committerHeiko <heiko@schaefer.name>2021-05-18 15:22:50 +0200
commitbf3048ae3312b1cc2871c94f12bc0d4bf488d7ff (patch)
tree085eaf0190b8dbbb191676aad5ca6c45a5347051
parentab09a69eea71ec88a0c0b80748b4e6f2447d64d4 (diff)
downloadopenpgp-ca-bf3048ae3312b1cc2871c94f12bc0d4bf488d7ff.tar.gz
Improve fn naming.
-rw-r--r--openpgp-ca-restd/src/process_certs.rs6
-rw-r--r--openpgp-ca-restd/src/restd.rs10
2 files changed, 8 insertions, 8 deletions
diff --git a/openpgp-ca-restd/src/process_certs.rs b/openpgp-ca-restd/src/process_certs.rs
index b49c57e..6d28723 100644
--- a/openpgp-ca-restd/src/process_certs.rs
+++ b/openpgp-ca-restd/src/process_certs.rs
@@ -39,7 +39,7 @@ const STANDARD_POLICY: &StandardPolicy = &StandardPolicy::new();
///
/// Assumption: the cert has been checked and found good by the
/// StandardPolicy for `now`.
-pub fn cert_to_warn(cert: &Cert) -> Result<Option<Vec<Warning>>, CertError> {
+pub fn get_warnings(cert: &Cert) -> Result<Option<Vec<Warning>>, CertError> {
let mut warns = Vec::new();
let now = SystemTime::now();
@@ -107,7 +107,7 @@ pub fn cert_to_warn(cert: &Cert) -> Result<Option<Vec<Warning>>, CertError> {
}
}
-pub fn cert_to_cert_info(cert: &Cert) -> Result<CertInfo, ReturnError> {
+pub fn get_cert_info(cert: &Cert) -> Result<CertInfo, ReturnError> {
cert.try_into().map_err(|e| {
ReturnError::new(
ReturnStatus::InternalError,
@@ -506,7 +506,7 @@ fn process_cert(
inactive: Some(inactive),
};
- let warn = cert_to_warn(&norm)
+ let warn = get_warnings(&norm)
.map_err(|ce| ReturnBadJson::new(ce, Some(cert_info.clone())))?;
Ok(ReturnGoodJson {
diff --git a/openpgp-ca-restd/src/restd.rs b/openpgp-ca-restd/src/restd.rs
index d7ccb4d..59e8034 100644
--- a/openpgp-ca-restd/src/restd.rs
+++ b/openpgp-ca-restd/src/restd.rs
@@ -20,7 +20,7 @@ use openpgp_ca_lib::pgp::Pgp;
use crate::cert_info::CertInfo;
use crate::json::*;
-use crate::process_certs::{cert_to_cert_info, cert_to_warn, process_certs};
+use crate::process_certs::{get_cert_info, get_warnings, process_certs};
use std::convert::TryInto;
static DB: OnceCell<Option<String>> = OnceCell::new();
@@ -116,8 +116,8 @@ fn certs_by_email(
)
})?;
- let cert_info = cert_to_cert_info(&cert)?;
- let warn = cert_to_warn(&cert).map_err(|ce| {
+ let cert_info = get_cert_info(&cert)?;
+ let warn = get_warnings(&cert).map_err(|ce| {
ReturnError::new(
ReturnStatus::InternalError,
format!(
@@ -167,8 +167,8 @@ fn cert_by_fp(
)
})?;
- let cert_info = cert_to_cert_info(&cert)?;
- let warn = cert_to_warn(&cert).map_err(|ce| {
+ let cert_info = get_cert_info(&cert)?;
+ let warn = get_warnings(&cert).map_err(|ce| {
ReturnError::new(
ReturnStatus::InternalError,
format!(