-
-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Hi,
The signature for AuthorizationHandle::challenge
is:
Line 397 in 1cc1b82
pub fn challenge(&'a mut self, r#type: ChallengeType) -> Option<ChallengeHandle<'a>> { |
I am trying to write code that reads from the authorization after I'm done with the challenge:
use instant_acme::{Authorization, ChallengeType};
fn main() {
let authorization: Authorization = todo!();
let Some(challenge) = authorization.challenge(ChallengeType::Dns01) else {
eprintln!(
"Missing DNS-01 challenge for authorization {:?}",
authorization.identifier().identifier
);
return;
};
println!("Challenge identifier: {:?}", challenge.identifier());
}
This code does not compile. I think it is because, in challenge
, the lifetime of the mutable reference to the AuthorizationHandle<'a>
is forced to be the maximum lifetime 'a
.
Would it be possible to use a different lifetime 'a: 'b
instead of 'a
here? I tested the following patch and it makes the code above work:
- pub fn challenge(&'a mut self, r#type: ChallengeType) -> Option<ChallengeHandle<'a>> {
+ pub fn challenge(&mut self, r#type: ChallengeType) -> Option<ChallengeHandle<'_>> {
p32blo
Metadata
Metadata
Assignees
Labels
No labels