Skip to content

Commit 481e962

Browse files
committed
style: apply rustfmt to http + cli modules
Pure formatting normalization (line wrapping, trailing blank lines) of pre-existing drift, surfaced when rustfmt resolved these submodules. No behavior change.
1 parent 5c98d9c commit 481e962

12 files changed

Lines changed: 23 additions & 36 deletions

File tree

crates/transport-cli/src/commands/oauth.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,10 @@ pub async fn run(
428428
// HTTP config endpoint serves). Secret VALUES are
429429
// deliberately omitted — `configured` already conveys
430430
// their presence.
431-
let summaries = registry.oauth.provider_summaries(&std::collections::HashMap::new()).await;
431+
let summaries = registry
432+
.oauth
433+
.provider_summaries(&std::collections::HashMap::new())
434+
.await;
432435
out.emit(&serde_json::json!({ "providers": summaries }))?;
433436
Ok(())
434437
}
@@ -437,19 +440,16 @@ pub async fn run(
437440
client_id,
438441
client_secret_from,
439442
} => {
440-
let secret = crate::secret_input::read_optional_secret(
441-
client_secret_from,
442-
"client secret",
443-
)?;
443+
let secret =
444+
crate::secret_input::read_optional_secret(client_secret_from, "client secret")?;
444445
registry
445446
.oauth
446-
.set_provider_credentials(
447-
&provider,
448-
client_id,
449-
secret.map(|s| s.to_string()),
450-
)
447+
.set_provider_credentials(&provider, client_id, secret.map(|s| s.to_string()))
451448
.await?;
452-
let summaries = registry.oauth.provider_summaries(&std::collections::HashMap::new()).await;
449+
let summaries = registry
450+
.oauth
451+
.provider_summaries(&std::collections::HashMap::new())
452+
.await;
453453
out.emit(&serde_json::json!({ "providers": summaries }))?;
454454
Ok(())
455455
}

crates/transport-cli/src/commands/system.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,7 @@ pub async fn run(
242242
url,
243243
stream_key_from,
244244
} => {
245-
let stream_key =
246-
crate::secret_input::read_secret(stream_key_from, "Stream key")?;
245+
let stream_key = crate::secret_input::read_secret(stream_key_from, "Stream key")?;
247246
let result =
248247
spiritstream_core::commands::test_rtmp_target(url, stream_key.to_string())?;
249248
out.emit(&result)?;

crates/transport-http/src/chat_lifecycle/reconnect.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
//! activation) passes `false` so a genuinely-dead sign-in doesn't churn the
1414
//! connection on every save.
1515
16-
use spiritstream_core::models::{ChatConnectionStatus, ChatPlatform, ChatSettings, ProfileSettings};
16+
use spiritstream_core::models::{
17+
ChatConnectionStatus, ChatPlatform, ChatSettings, ProfileSettings,
18+
};
1719

1820
use crate::AppState;
1921

crates/transport-http/src/chat_lifecycle/youtube.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ pub(crate) async fn connect_youtube_chat(
200200
// is the actionable message ("go live first" / "quota
201201
// exhausted"), not the opaque "internal error".
202202
let reason = connect_failure_reason(&e);
203-
let calm =
204-
youtube_status(state).await == Some(ChatConnectionStatus::Disconnected);
203+
let calm = youtube_status(state).await == Some(ChatConnectionStatus::Disconnected);
205204
let quota = reason.to_lowercase().contains("quota");
206205
// Only the not-live registration lag is worth a bounded retry;
207206
// retrying an exhausted quota just burns more of it.

crates/transport-http/src/lib/static_ui.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ pub(crate) fn loading_page_style_csp_hash() -> String {
111111
)
112112
}
113113

114-
115114
/// Mount `/`, `/index.html`, and the asset fallback when UI serving is
116115
/// enabled and the bundle directory exists.
117116
pub(crate) fn mount_static_ui(

crates/transport-http/src/middleware.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,7 @@ pub(crate) fn client_ip(
114114
if trusted.is_empty() || !trusted.iter().any(|net| net.contains(&peer)) {
115115
return peer;
116116
}
117-
let Some(xff) = headers
118-
.get("x-forwarded-for")
119-
.and_then(|v| v.to_str().ok())
120-
else {
117+
let Some(xff) = headers.get("x-forwarded-for").and_then(|v| v.to_str().ok()) else {
121118
return peer;
122119
};
123120
for entry in xff.split(',').rev() {
@@ -349,11 +346,7 @@ mod client_ip_tests {
349346
#[test]
350347
fn xff_from_untrusted_peer_is_ignored() {
351348
let trusted = nets(&["172.18.0.0/16"]);
352-
let got = client_ip(
353-
ip("203.0.113.9"),
354-
&headers_with_xff("10.0.0.1"),
355-
&trusted,
356-
);
349+
let got = client_ip(ip("203.0.113.9"), &headers_with_xff("10.0.0.1"), &trusted);
357350
assert_eq!(got, ip("203.0.113.9"));
358351
}
359352

crates/transport-http/src/v1/chat/log.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ pub async fn v1_chat_export_log_proxy(
9494
context: format!("Failed to write export file: {e}"),
9595
}
9696
})?;
97-
writer.write_all(b"\n").map_err(|e| {
98-
spiritstream_core::CoreError::Internal {
97+
writer
98+
.write_all(b"\n")
99+
.map_err(|e| spiritstream_core::CoreError::Internal {
99100
context: format!("Failed to write export file: {e}"),
100-
}
101-
})?;
101+
})?;
102102
}
103103
}
104104
}

crates/transport-http/src/v1/chat_message_wire/atoms.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,3 @@ impl From<TextStyle> for TextStyleWire {
8787
}
8888
}
8989
}
90-

crates/transport-http/src/v1/chat_message_wire/author.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,3 @@ impl From<ReplyContext> for ReplyContextWire {
7878
}
7979
}
8080
}
81-

crates/transport-http/src/v1/chat_message_wire/events.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,4 +281,3 @@ impl From<ChatEvent> for ChatEventWire {
281281
}
282282
}
283283
}
284-

0 commit comments

Comments
 (0)