Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Satisfy the ELIDED_NAMED_LIFETIMES builtin lint. #104

Merged
merged 2 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,15 @@ pub fn load_and_validate(path: &std::path::Path) -> Result<Document> {
}

for cert in &doc.certificates {
if entity_names.get(cert.subject_entity.as_str()).is_none() {
if !entity_names.contains(cert.subject_entity.as_str()) {
miette::bail!(
"certificate \"{}\" subject entity \"{}\" does not exist",
cert.name,
cert.subject_key
)
}

if kp_names.get(cert.subject_key.as_str()).is_none() {
if !kp_names.contains(cert.subject_key.as_str()) {
miette::bail!(
"certificate \"{}\" subject key pair \"{}\" does not exist",
cert.name,
Expand All @@ -375,7 +375,7 @@ pub fn load_and_validate(path: &std::path::Path) -> Result<Document> {
(None, None) => miette::bail!("certificate \"{}\" must specify either an issuer entity or certificate", cert.name),
(Some(_), Some(_)) => miette::bail!("certificate \"{}\" specifies both an issuer entity and certificate. Only one may be specified.", cert.name),
(Some(entity), None) => {
if entity_names.get(entity.as_str()).is_none() {
if !entity_names.contains(entity.as_str()) {
miette::bail!(
"certificate \"{}\" issuer entity \"{}\" does not exist",
cert.name,
Expand All @@ -384,7 +384,7 @@ pub fn load_and_validate(path: &std::path::Path) -> Result<Document> {
}
}
(None, Some(cert_name)) => {
if cert_names.get(cert_name.as_str()).is_none() {
if !cert_names.contains(cert_name.as_str()) {
miette::bail!(
"certificate \"{}\" issuer certificate \"{}\" does not exist",
cert.name,
Expand All @@ -394,7 +394,7 @@ pub fn load_and_validate(path: &std::path::Path) -> Result<Document> {
}
}

if kp_names.get(cert.issuer_key.as_str()).is_none() {
if !kp_names.contains(cert.issuer_key.as_str()) {
miette::bail!(
"certificate \"{}\" issuer key pair \"{}\" does not exist",
cert.name,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl<'a> Entity {
&self.name
}

pub fn distinguished_name(&'a self) -> &Name {
pub fn distinguished_name(&'a self) -> &'a Name {
&self.distinguished_name
}
}
Expand Down
Loading