Skip to content

Commit e82c02c

Browse files
style: cargo fmt
1 parent 8a749c2 commit e82c02c

File tree

2 files changed

+31
-9
lines changed

2 files changed

+31
-9
lines changed

src/helpers/events/renew.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ pub(super) async fn handle_renew(
5353
"note": "Run without --dry-run to actually renew subscriptions"
5454
})
5555
};
56-
println!("{}", serde_json::to_string_pretty(&result).context("Failed to serialize dry-run output")?);
56+
println!(
57+
"{}",
58+
serde_json::to_string_pretty(&result).context("Failed to serialize dry-run output")?
59+
);
5760
return Ok(());
5861
}
5962

@@ -78,7 +81,10 @@ pub(super) async fn handle_renew(
7881
.context("Failed to reactivate subscription")?;
7982

8083
let body: Value = resp.json().await.context("Failed to parse response")?;
81-
println!("{}", serde_json::to_string_pretty(&body).context("Failed to serialize response body")?);
84+
println!(
85+
"{}",
86+
serde_json::to_string_pretty(&body).context("Failed to serialize response body")?
87+
);
8288
} else {
8389
let within_secs = parse_duration(&config.within)?;
8490
let resp = client
@@ -119,7 +125,10 @@ pub(super) async fn handle_renew(
119125
"status": "success",
120126
"renewed": renewed,
121127
});
122-
println!("{}", serde_json::to_string_pretty(&result).context("Failed to serialize result")?);
128+
println!(
129+
"{}",
130+
serde_json::to_string_pretty(&result).context("Failed to serialize result")?
131+
);
123132
}
124133

125134
Ok(())

src/helpers/events/subscribe.rs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ pub(super) async fn handle_subscribe(
134134
"subscription": sub_name.0,
135135
"note": "Run without --dry-run to actually start listening"
136136
});
137-
println!("{}", serde_json::to_string_pretty(&result).context("Failed to serialize dry-run output")?);
137+
println!(
138+
"{}",
139+
serde_json::to_string_pretty(&result)
140+
.context("Failed to serialize dry-run output")?
141+
);
138142
return Ok(());
139143
}
140144
(sub_name.0.clone(), None, None, false)
@@ -172,7 +176,10 @@ pub(super) async fn handle_subscribe(
172176
eprintln!("Would create Pub/Sub topic: {topic}");
173177
eprintln!("Would create Pub/Sub subscription: {sub}");
174178
eprintln!("Would create Workspace Events subscription for target: {target}");
175-
eprintln!("Would listen for event types: {}", config.event_types.join(", "));
179+
eprintln!(
180+
"Would listen for event types: {}",
181+
config.event_types.join(", ")
182+
);
176183

177184
let result = json!({
178185
"dry_run": true,
@@ -183,15 +190,21 @@ pub(super) async fn handle_subscribe(
183190
"event_types": config.event_types,
184191
"note": "Run without --dry-run to actually create subscription"
185192
});
186-
println!("{}", serde_json::to_string_pretty(&result).context("Failed to serialize dry-run output")?);
193+
println!(
194+
"{}",
195+
serde_json::to_string_pretty(&result)
196+
.context("Failed to serialize dry-run output")?
197+
);
187198
return Ok(());
188199
}
189200

190201
// 1. Create Pub/Sub topic
191202
eprintln!("Creating Pub/Sub topic: {topic}");
192-
let token = pubsub_token
193-
.as_ref()
194-
.ok_or_else(|| GwsError::Auth("Token unavailable in non-dry-run mode. This indicates a bug.".to_string()))?;
203+
let token = pubsub_token.as_ref().ok_or_else(|| {
204+
GwsError::Auth(
205+
"Token unavailable in non-dry-run mode. This indicates a bug.".to_string(),
206+
)
207+
})?;
195208
let resp = client
196209
.put(format!("{PUBSUB_API_BASE}/{topic}"))
197210
.bearer_auth(token)

0 commit comments

Comments
 (0)