Skip to content

Commit

Permalink
Remove redundant feature attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Oct 21, 2023
1 parent 9263e17 commit 546b64b
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions nautilus_core/model/src/python/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ pub mod types;
pub const PY_MODULE_MODEL: &str = "nautilus_trader.core.nautilus_pyo3.model";

/// Python iterator over the variants of an enum.
#[cfg(feature = "python")]
#[pyclass]
pub struct EnumIterator {
// Type erasure for code reuse. Generic types can't be exposed to Python.
iter: Box<dyn Iterator<Item = PyObject> + Send>,
}

#[cfg(feature = "python")]
#[pymethods]
impl EnumIterator {
fn __iter__(slf: PyRef<'_, Self>) -> PyRef<'_, Self> {
Expand All @@ -53,7 +51,6 @@ impl EnumIterator {
}
}

#[cfg(feature = "python")]
impl EnumIterator {
pub fn new<E>(py: Python<'_>) -> Self
where
Expand All @@ -72,7 +69,6 @@ impl EnumIterator {
}
}

#[cfg(feature = "python")]
pub fn value_to_pydict(py: Python<'_>, val: &Value) -> PyResult<Py<PyDict>> {
let dict = PyDict::new(py);

Expand All @@ -90,7 +86,6 @@ pub fn value_to_pydict(py: Python<'_>, val: &Value) -> PyResult<Py<PyDict>> {
Ok(dict.into_py(py))
}

#[cfg(feature = "python")]
pub fn value_to_pyobject(py: Python<'_>, val: &Value) -> PyResult<PyObject> {
match val {
Value::Null => Ok(py.None()),
Expand Down Expand Up @@ -121,7 +116,6 @@ pub fn value_to_pyobject(py: Python<'_>, val: &Value) -> PyResult<PyObject> {
}

#[cfg(test)]
#[cfg(feature = "python")]
mod tests {
use pyo3::{
prelude::*,
Expand Down

0 comments on commit 546b64b

Please sign in to comment.