Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/element/resolved_element_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl ResolvedElementData {
}

pub fn set_shot(&mut self, value: &String) {
self.shot = Some(value.to_lowercase());
self.shot = Some(value.clone());
}

pub fn get_shot(&self) -> Option<String> {
Expand Down
7 changes: 2 additions & 5 deletions src/core/shot/shot_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ impl ShotResolver for Project {
}

fn shot_exists(&self, shot: &String) -> bool {
let shots: Vec<String> = self.get_shots().iter().map(|s| s.to_lowercase()).collect();
return shots.contains(&shot.to_lowercase());
return self.get_shots().contains(shot);
}

fn get_shot_formatted(&self, shot: &String) -> Option<String> {
let shots = self.get_shots();
let index = shots
.iter()
.position(|s| s.to_lowercase() == shot.to_lowercase());
let index = shots.iter().position(|s| s == shot);

let formatted: Option<String> = match index {
Some(i) => Some(shots.index(i).clone()),
Expand Down