Skip to content

Commit 190e645

Browse files
committed
fix cargo fmt
1 parent b43bf67 commit 190e645

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

bin/cli/src/main.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,13 @@ async fn main() -> Result<()> {
129129

130130
// Run the calibrator to get the metrics.
131131
println!("Starting calibration...");
132-
let calibrator = SinglePassCalibrator::new(SPN_FIBONACCI_ELF.to_vec(), stdin, args.usd_cost_per_hour, args.utilization_rate, args.profit_margin);
132+
let calibrator = SinglePassCalibrator::new(
133+
SPN_FIBONACCI_ELF.to_vec(),
134+
stdin,
135+
args.usd_cost_per_hour,
136+
args.utilization_rate,
137+
args.profit_margin,
138+
);
133139
let metrics =
134140
calibrator.calibrate().map_err(|e| anyhow!("failed to calibrate: {}", e))?;
135141

@@ -150,7 +156,10 @@ async fn main() -> Result<()> {
150156
},
151157
CalibrationResultsTable {
152158
name: "Estimated Bid Price".to_string(),
153-
value: format!("{:.2} $PROVE per 1B PGUs", metrics.pgu_price * args.prove_price * 1_000_000_000.0),
159+
value: format!(
160+
"{:.2} $PROVE per 1B PGUs",
161+
metrics.pgu_price * args.prove_price * 1_000_000_000.0
162+
),
154163
},
155164
];
156165

crates/calibrator/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ mod tests {
122122
let cost_per_hour = 0.1;
123123
let utilization_rate = 0.5;
124124
let profit_margin = 0.1;
125-
let calibrator = SinglePassCalibrator::new(elf, stdin, cost_per_hour, utilization_rate, profit_margin);
125+
let calibrator =
126+
SinglePassCalibrator::new(elf, stdin, cost_per_hour, utilization_rate, profit_margin);
126127

127128
// Calibrate the prover.
128129
let metrics = calibrator.calibrate().unwrap();

crates/rpc/src/retry.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ where
5555
// Check for tonic status errors.
5656
if let Some(status) = e.downcast_ref::<tonic::Status>() {
5757
match status.code() {
58-
Code::Unavailable |
59-
Code::DeadlineExceeded |
60-
Code::Internal |
61-
Code::Aborted => {
58+
Code::Unavailable
59+
| Code::DeadlineExceeded
60+
| Code::Internal
61+
| Code::Aborted => {
6262
warn!(
6363
"Network temporarily unavailable when {} due to {}, retrying...",
6464
operation_name,
@@ -83,14 +83,14 @@ where
8383
} else {
8484
// Check for common transport errors.
8585
let error_msg = e.to_string().to_lowercase();
86-
let is_transient = error_msg.contains("tls handshake") ||
87-
error_msg.contains("dns error") ||
88-
error_msg.contains("connection reset") ||
89-
error_msg.contains("broken pipe") ||
90-
error_msg.contains("transport error") ||
91-
error_msg.contains("failed to lookup") ||
92-
error_msg.contains("timeout") ||
93-
error_msg.contains("deadline exceeded");
86+
let is_transient = error_msg.contains("tls handshake")
87+
|| error_msg.contains("dns error")
88+
|| error_msg.contains("connection reset")
89+
|| error_msg.contains("broken pipe")
90+
|| error_msg.contains("transport error")
91+
|| error_msg.contains("failed to lookup")
92+
|| error_msg.contains("timeout")
93+
|| error_msg.contains("deadline exceeded");
9494

9595
if is_transient {
9696
warn!(

0 commit comments

Comments
 (0)