Skip to content

Commit c511f4b

Browse files
committed
More stuff
1 parent ebf975b commit c511f4b

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

crackers_python/src/config/mod.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use crate::config::constraint::PythonConstraintConfig;
2+
use crate::synthesis::PythonSynthesisParams;
23
use crackers::config::meta::MetaConfig;
34
use crackers::config::sleigh::SleighConfig;
45
use crackers::config::specification::SpecificationConfig;
@@ -42,10 +43,10 @@ impl TryFrom<CrackersConfig> for PythonCrackersConfig {
4243
}
4344
}
4445

45-
impl TryFrom<PythonCrackersConfig> for CrackersConfig {
46+
impl TryFrom<&PythonCrackersConfig> for CrackersConfig {
4647
type Error = PyErr;
4748

48-
fn try_from(value: PythonCrackersConfig) -> Result<Self, Self::Error> {
49+
fn try_from(value: &PythonCrackersConfig) -> Result<Self, Self::Error> {
4950
Python::with_gil(|py|{
5051

5152
Ok(CrackersConfig{
@@ -70,4 +71,10 @@ impl PythonCrackersConfig {
7071
toml_edit::de::from_str(&s).map_err(|e| PyRuntimeError::new_err(format!("{}", e)))?;
7172
p.try_into()
7273
}
74+
75+
pub fn resolve_config(&self) -> PyResult<PythonSynthesisParams> {
76+
let cfg = CrackersConfig::try_from(self)?;
77+
let syn = cfg.resolve()?;
78+
Ok(PythonSynthesisParams{inner: syn})
79+
}
7380
}

crackers_python/src/synthesis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use pyo3::{pyclass, pymethods, Py, PyResult, Python};
77

88
#[pyclass]
99
pub struct PythonSynthesisParams {
10-
inner: SynthesisParams,
10+
pub inner: SynthesisParams,
1111
}
1212

1313
#[pymethods]

0 commit comments

Comments
 (0)