style(sidecar): rustfmt-wrap wide signatures/calls
The release workflow's `cargo fmt --check` gate failed on the Protocol 2.0 additions: upsert_guild/upsert_house signatures and their call sites in main.rs exceeded rustfmt's default width. Reformatted with `cargo fmt` — no behavioral change. `cargo fmt --check`, `cargo check`, and `cargo test` all clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -142,7 +142,12 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
"guild.update" => {
|
"guild.update" => {
|
||||||
if let Some(id) = ev.value.get("id").and_then(|v| v.as_i64()) {
|
if let Some(id) = ev.value.get("id").and_then(|v| v.as_i64()) {
|
||||||
if let Err(e) = event_store
|
if let Err(e) = event_store
|
||||||
.upsert_guild(id, ev.value.get("name").and_then(|n| n.as_str()), &text, t)
|
.upsert_guild(
|
||||||
|
id,
|
||||||
|
ev.value.get("name").and_then(|n| n.as_str()),
|
||||||
|
&text,
|
||||||
|
t,
|
||||||
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
tracing::warn!(error = %e, "failed to upsert guild board");
|
tracing::warn!(error = %e, "failed to upsert guild board");
|
||||||
@@ -170,7 +175,12 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
"house.update" => {
|
"house.update" => {
|
||||||
if let Some(serial) = ev.value.get("serial").and_then(|s| s.as_str()) {
|
if let Some(serial) = ev.value.get("serial").and_then(|s| s.as_str()) {
|
||||||
if let Err(e) = event_store
|
if let Err(e) = event_store
|
||||||
.upsert_house(serial, ev.value.get("name").and_then(|n| n.as_str()), &text, t)
|
.upsert_house(
|
||||||
|
serial,
|
||||||
|
ev.value.get("name").and_then(|n| n.as_str()),
|
||||||
|
&text,
|
||||||
|
t,
|
||||||
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
tracing::warn!(error = %e, "failed to upsert house registry");
|
tracing::warn!(error = %e, "failed to upsert house registry");
|
||||||
|
|||||||
@@ -192,7 +192,13 @@ impl Store {
|
|||||||
|
|
||||||
/// Upserts one guild's latest state, keyed by guild id. Fed from `guild.update`; one row per
|
/// Upserts one guild's latest state, keyed by guild id. Fed from `guild.update`; one row per
|
||||||
/// guild, always the most recent snapshot. This is the board the website reads on load.
|
/// guild, always the most recent snapshot. This is the board the website reads on load.
|
||||||
pub async fn upsert_guild(&self, id: i64, name: Option<&str>, json: &str, t: i64) -> anyhow::Result<()> {
|
pub async fn upsert_guild(
|
||||||
|
&self,
|
||||||
|
id: i64,
|
||||||
|
name: Option<&str>,
|
||||||
|
json: &str,
|
||||||
|
t: i64,
|
||||||
|
) -> anyhow::Result<()> {
|
||||||
sqlx::query(
|
sqlx::query(
|
||||||
"INSERT INTO guilds (id, name, json, updated_t) VALUES (?, ?, ?, ?)
|
"INSERT INTO guilds (id, name, json, updated_t) VALUES (?, ?, ?, ?)
|
||||||
ON CONFLICT(id) DO UPDATE SET name = excluded.name, json = excluded.json, updated_t = excluded.updated_t",
|
ON CONFLICT(id) DO UPDATE SET name = excluded.name, json = excluded.json, updated_t = excluded.updated_t",
|
||||||
@@ -250,7 +256,13 @@ impl Store {
|
|||||||
// ---- house registry (Protocol 2.0) ----
|
// ---- house registry (Protocol 2.0) ----
|
||||||
|
|
||||||
/// Upserts one house's latest state, keyed by serial. Fed from `house.update`.
|
/// Upserts one house's latest state, keyed by serial. Fed from `house.update`.
|
||||||
pub async fn upsert_house(&self, serial: &str, name: Option<&str>, json: &str, t: i64) -> anyhow::Result<()> {
|
pub async fn upsert_house(
|
||||||
|
&self,
|
||||||
|
serial: &str,
|
||||||
|
name: Option<&str>,
|
||||||
|
json: &str,
|
||||||
|
t: i64,
|
||||||
|
) -> anyhow::Result<()> {
|
||||||
sqlx::query(
|
sqlx::query(
|
||||||
"INSERT INTO houses (serial, name, json, updated_t) VALUES (?, ?, ?, ?)
|
"INSERT INTO houses (serial, name, json, updated_t) VALUES (?, ?, ?, ?)
|
||||||
ON CONFLICT(serial) DO UPDATE SET name = excluded.name, json = excluded.json, updated_t = excluded.updated_t",
|
ON CONFLICT(serial) DO UPDATE SET name = excluded.name, json = excluded.json, updated_t = excluded.updated_t",
|
||||||
|
|||||||
Reference in New Issue
Block a user