Skip to content

Commit

Permalink
minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Aug 17, 2024
1 parent 084fb0a commit eedd815
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Minor cleanups

## [2.5.1] - 2024-08-09

### Fixed
Expand Down
15 changes: 1 addition & 14 deletions src/rs/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct Symbol {

// idk if it is worth to continue maintaining this, given the complexity introduced by other features
#[cfg(feature = "python_bindings")]
#[cfg(not(feature = "serde"))]
#[cfg_attr(feature = "serde", serde(skip))]
chached_name: Option<PyObject>,
}

Expand All @@ -46,7 +46,6 @@ impl Symbol {
align,

#[cfg(feature = "python_bindings")]
#[cfg(not(feature = "serde"))]
chached_name: None,
}
}
Expand All @@ -60,7 +59,6 @@ impl Symbol {
align: None,

#[cfg(feature = "python_bindings")]
#[cfg(not(feature = "serde"))]
chached_name: None,
}
}
Expand Down Expand Up @@ -152,7 +150,6 @@ pub(crate) mod python_bindings {
/* Getters and setters */

#[getter]
#[cfg(not(feature = "serde"))]
fn get_name(&mut self) -> PyObject {
Python::with_gil(|py| {
if self.chached_name.is_none() {
Expand All @@ -163,18 +160,8 @@ pub(crate) mod python_bindings {
})
}

#[getter]
#[cfg(feature = "serde")]
fn get_name(&self) -> PyResult<String> {
Ok(self.name.clone())
}

#[setter]
fn set_name(&mut self, value: String) -> PyResult<()> {
#[cfg(not(feature = "serde"))]
{
self.chached_name = None;
}
self.name = value;
Ok(())
}
Expand Down

0 comments on commit eedd815

Please sign in to comment.