Skip to content

Commit 9de4863

Browse files
author
Rob Fitzgerald
authored
Merge pull request #493 from NatLabRockies/rjf/state-model-contains-key
Rjf/state model contains key
2 parents e0d2916 + 2c221b0 commit 9de4863

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

  • rust

rust/routee-compass-core/src/model/state/state_model.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl StateModel {
110110
self.0.is_empty()
111111
}
112112

113-
pub fn contains_key(&self, k: &String) -> bool {
113+
pub fn contains_key(&self, k: &str) -> bool {
114114
self.0.contains_key(k)
115115
}
116116

rust/routee-compass-powertrain/src/model/charging/battery/model.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl ConstraintModel for BatteryFilter {
2020
state: &[StateVariable],
2121
state_model: &StateModel,
2222
) -> Result<bool, ConstraintModelError> {
23-
if !state_model.contains_key(&fieldname::TRIP_SOC.to_string()) {
23+
if !state_model.contains_key(fieldname::TRIP_SOC) {
2424
// if we don't have the trip_soc, then this frontier is valid
2525
return Ok(true);
2626
}

0 commit comments

Comments
 (0)