Skip to content

Commit

Permalink
Migrate sct to declarative modules API
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Jul 9, 2024
1 parent 67a5215 commit 88f666f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ mod _rust {

#[pyo3::pymodule]
mod x509 {
#[pymodule_export]
use crate::x509::sct::Sct;
#[pymodule_export]
use crate::x509::verify::{
PolicyBuilder, PyClientVerifier, PyServerVerifier, PyStore, PyVerifiedClient,
Expand All @@ -119,7 +121,6 @@ mod _rust {
crate::x509::common::add_to_module(x509_mod)?;
crate::x509::crl::add_to_module(x509_mod)?;
crate::x509::csr::add_to_module(x509_mod)?;
crate::x509::sct::add_to_module(x509_mod)?;

Ok(())
}
Expand Down
8 changes: 1 addition & 7 deletions src/rust/src/x509/sct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};

use pyo3::types::{PyAnyMethods, PyDictMethods, PyListMethods, PyModuleMethods};
use pyo3::types::{PyAnyMethods, PyDictMethods, PyListMethods};
use pyo3::ToPyObject;

use crate::error::CryptographyError;
Expand Down Expand Up @@ -259,12 +259,6 @@ pub(crate) fn parse_scts(
Ok(py_scts.to_object(py))
}

pub(crate) fn add_to_module(module: &pyo3::Bound<'_, pyo3::types::PyModule>) -> pyo3::PyResult<()> {
module.add_class::<Sct>()?;

Ok(())
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit 88f666f

Please sign in to comment.