Skip to content

Commit

Permalink
Add method to get soltab names and make function naming more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
tikk3r committed Jul 28, 2024
1 parent 6e13747 commit d1b8cc5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,21 @@ impl SolSet {
});
}

pub fn getSolTabs(&self) -> &Vec<SolTab> {
pub fn get_soltabs(&self) -> &Vec<SolTab> {
return &self.soltabs;
}

pub fn getSolTab(&self, st_name: String) -> Result<&SolTab, anyhow::Error> {
pub fn get_soltab_names(&self) -> Vec<String> {
let names = self
.soltabs
.iter()
.map(|ss| ss.name.clone())
.collect::<Vec<String>>()
.to_vec();
return names;
}

pub fn get_soltab(&self, st_name: String) -> Result<&SolTab, anyhow::Error> {
let index: i32 = if self.has_soltab(&st_name) {
self.soltabs
.iter()
Expand Down

0 comments on commit d1b8cc5

Please sign in to comment.