Skip to content

Commit

Permalink
hierarchy: change access to use index syntax instead of get method
Browse files Browse the repository at this point in the history
  • Loading branch information
ekiwi committed Jan 24, 2025
1 parent 156ba25 commit 942e046
Show file tree
Hide file tree
Showing 10 changed files with 170 additions and 222 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ members = ["wellen", "pywellen"]
default-members = ["wellen"]

[workspace.package]
version = "0.13.12"
version = "0.14.0"
edition = "2021"
# we require the `div_ceil` method on integers
rust-version = "1.73.0"
Expand Down
9 changes: 4 additions & 5 deletions pywellen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use convert::Mappable;
use num_bigint::BigUint;
use pyo3::types::PyInt;
use pyo3::{exceptions::PyRuntimeError, prelude::*};
use wellen::GetItem;

use wellen::{
viewers::{self},
Expand Down Expand Up @@ -53,7 +52,7 @@ impl Hierarchy {
ScopeIter(Box::new({
let hier = self.0.clone();
hier.scopes()
.map(|val| Scope(hier.get(val).clone()))
.map(|val| Scope(hier[val].clone()))
.collect::<Vec<_>>()
.into_iter()
}))
Expand Down Expand Up @@ -84,7 +83,7 @@ impl Scope {
let hier = locahier.clone();
scope
.vars(&hier.0)
.map(|val| Var(hier.0.get(val).clone()))
.map(|val| Var(hier.0[val].clone()))
.collect::<Vec<_>>()
.into_iter()
}))
Expand All @@ -102,7 +101,7 @@ impl Scope {
let hier = locahier.clone();
scope
.scopes(&hier.0)
.map(|val| Scope(hier.0.get(val).clone()))
.map(|val| Scope(hier.0[val].clone()))
.collect::<Vec<_>>()
.into_iter()
}))
Expand Down Expand Up @@ -248,7 +247,7 @@ impl Waveform {
.ok_or(PyRuntimeError::new_err(format!(
"No var at path {abs_hierarchy_path}"
)))?;
let var = self.hierarchy.0.get(maybe_var);
let var = &self.hierarchy.0[maybe_var];
self.get_signal(&Var(var.clone()), py)
}
}
Expand Down
Loading

0 comments on commit 942e046

Please sign in to comment.