Skip to content

Commit

Permalink
refactor: replace returning pyobject with bound<'p, pyany> in x509::c…
Browse files Browse the repository at this point in the history
…ertificate::parse_distribution_point (#11972)

Signed-off-by: oleg.hoefling <[email protected]>
  • Loading branch information
hoefling authored Nov 16, 2024
1 parent 8c5b99d commit 51ef76c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/rust/src/x509/certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,10 +609,10 @@ pub(crate) fn parse_distribution_point_name(
})
}

fn parse_distribution_point(
py: pyo3::Python<'_>,
fn parse_distribution_point<'p>(
py: pyo3::Python<'p>,
dp: DistributionPoint<'_>,
) -> Result<pyo3::PyObject, CryptographyError> {
) -> CryptographyResult<pyo3::Bound<'p, pyo3::PyAny>> {
let (full_name, relative_name) = match dp.distribution_point {
Some(data) => parse_distribution_point_name(py, data)?,
None => (py.None(), py.None()),
Expand All @@ -625,8 +625,7 @@ fn parse_distribution_point(
};
Ok(types::DISTRIBUTION_POINT
.get(py)?
.call1((full_name, relative_name, reasons, crl_issuer))?
.unbind())
.call1((full_name, relative_name, reasons, crl_issuer))?)
}

pub(crate) fn parse_distribution_points<'p>(
Expand Down

0 comments on commit 51ef76c

Please sign in to comment.