Skip to content

Commit 088147c

Browse files
committed
fix: remove unnecessary borrows on format! (clippy 1.93+)
1 parent 553efce commit 088147c

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

crates/agentic-contract/tests/phase2_engine_inventions.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ fn test_stress_2000_policies() {
474474
2 => PolicyAction::RequireApproval,
475475
_ => PolicyAction::AuditOnly,
476476
};
477-
engine.add_policy(Policy::new(&format!("Policy {}", i), scope, action));
477+
engine.add_policy(Policy::new(format!("Policy {}", i), scope, action));
478478
}
479479
let policies = engine.list_policies(None);
480480
assert_eq!(policies.len(), 2000);
@@ -490,7 +490,7 @@ fn test_stress_1000_risk_limits() {
490490
2 => LimitType::Budget,
491491
_ => LimitType::Count,
492492
};
493-
engine.add_risk_limit(RiskLimit::new(&format!("Limit {}", i), lt, (i + 1) as f64));
493+
engine.add_risk_limit(RiskLimit::new(format!("Limit {}", i), lt, (i + 1) as f64));
494494
}
495495
let limits = engine.list_risk_limits();
496496
assert_eq!(limits.len(), 1000);
@@ -507,9 +507,9 @@ fn test_stress_2000_violations() {
507507
_ => ViolationSeverity::Fatal,
508508
};
509509
engine.report_violation(Violation::new(
510-
&format!("Violation {}", i),
510+
format!("Violation {}", i),
511511
sev,
512-
&format!("agent_{}", i % 10),
512+
format!("agent_{}", i % 10),
513513
));
514514
}
515515
let all = engine.list_violations(None);
@@ -524,9 +524,9 @@ fn test_stress_500_obligations() {
524524
let mut engine = fresh();
525525
for i in 0..500 {
526526
let mut o = Obligation::new(
527-
&format!("Obligation {}", i),
528-
&format!("Description {}", i),
529-
&format!("agent_{}", i % 5),
527+
format!("Obligation {}", i),
528+
format!("Description {}", i),
529+
format!("agent_{}", i % 5),
530530
);
531531
if i % 2 == 0 {
532532
o = o.with_deadline(future_dt());
@@ -549,17 +549,17 @@ fn test_file_roundtrip_loaded() {
549549
let mut engine = fresh();
550550
for i in 0..100 {
551551
engine.add_policy(Policy::new(
552-
&format!("P{}", i),
552+
format!("P{}", i),
553553
PolicyScope::Global,
554554
PolicyAction::Deny,
555555
));
556-
engine.add_risk_limit(RiskLimit::new(&format!("L{}", i), LimitType::Rate, 100.0));
556+
engine.add_risk_limit(RiskLimit::new(format!("L{}", i), LimitType::Rate, 100.0));
557557
engine.report_violation(Violation::new(
558-
&format!("V{}", i),
558+
format!("V{}", i),
559559
ViolationSeverity::Info,
560560
"a1",
561561
));
562-
engine.add_obligation(Obligation::new(&format!("O{}", i), "desc", "a1"));
562+
engine.add_obligation(Obligation::new(format!("O{}", i), "desc", "a1"));
563563
}
564564

565565
engine.file.path = Some(path.clone());

0 commit comments

Comments
 (0)