Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Aug 9, 2024
1 parent c095a1d commit 9136c58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions nautilus_core/backtest/src/matching_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ impl OrderMatchingEngine {
// Contingent orders checks
if self.config.support_contingent_orders {
if let Some(parent_order_id) = order.parent_order_id() {
println!("Search for parent order {}", parent_order_id);
println!("Search for parent order {parent_order_id}");
let parent_order = cache_borrow.order(&parent_order_id);
if parent_order.is_none()
|| parent_order.unwrap().contingency_type().unwrap() != ContingencyType::Oto
Expand All @@ -284,7 +284,7 @@ impl OrderMatchingEngine {
if parent_order.status() == OrderStatus::Rejected && order.is_open() {
self.generate_order_rejected(
order,
format!("Rejected OTO order from {}", parent_order_id).into(),
format!("Rejected OTO order from {parent_order_id}").into(),
);
return;
} else if parent_order.status() == OrderStatus::Accepted
Expand Down Expand Up @@ -1343,7 +1343,7 @@ mod tests {
assert_eq!(first_message.event_type(), OrderEventType::Rejected);
assert_eq!(
first_message.message().unwrap(),
Ustr::from(format!("Rejected OTO order from {}", entry_client_order_id).as_str())
Ustr::from(format!("Rejected OTO order from {entry_client_order_id}").as_str())
);
}
}
2 changes: 1 addition & 1 deletion nautilus_core/common/src/cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ impl Cache {
// }
}

self.orders.insert(client_order_id, order.clone());
self.orders.insert(client_order_id, order);

Ok(())
}
Expand Down

0 comments on commit 9136c58

Please sign in to comment.