From 6f6eeb65954bb96954522deb330e40b746075ba6 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Wed, 7 Aug 2024 12:09:43 -0400 Subject: [PATCH] collab: Update how mode is displayed in root endpoint (#15911) This PR adjusts how we display the "mode" collab is running in on the root endpoint. It's minor, but it does make things a bit cleaner. Release Notes: - N/A --- Cargo.lock | 1 + crates/collab/Cargo.toml | 1 + crates/collab/src/lib.rs | 3 ++- crates/collab/src/main.rs | 5 +---- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8a3ebe21c3..12d287ac5d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2504,6 +2504,7 @@ dependencies = [ "settings", "sha2", "sqlx", + "strum", "subtle", "supermaven_api", "telemetry_events", diff --git a/crates/collab/Cargo.toml b/crates/collab/Cargo.toml index 19d04ac92e..eb68fd96ad 100644 --- a/crates/collab/Cargo.toml +++ b/crates/collab/Cargo.toml @@ -58,6 +58,7 @@ serde_derive.workspace = true serde_json.workspace = true sha2.workspace = true sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "postgres", "json", "time", "uuid", "any"] } +strum.workspace = true subtle.workspace = true rustc-demangle.workspace = true telemetry_events.workspace = true diff --git a/crates/collab/src/lib.rs b/crates/collab/src/lib.rs index a795b0e6ba..0463632e8f 100644 --- a/crates/collab/src/lib.rs +++ b/crates/collab/src/lib.rs @@ -235,7 +235,8 @@ impl Config { } /// The service mode that collab should run in. -#[derive(Debug, PartialEq, Eq, Clone, Copy)] +#[derive(Debug, PartialEq, Eq, Clone, Copy, strum::Display)] +#[strum(serialize_all = "snake_case")] pub enum ServiceMode { Api, Collab, diff --git a/crates/collab/src/main.rs b/crates/collab/src/main.rs index f28d560613..ec11bb6543 100644 --- a/crates/collab/src/main.rs +++ b/crates/collab/src/main.rs @@ -279,10 +279,7 @@ async fn setup_llm_database(config: &Config) -> Result<()> { } async fn handle_root(Extension(mode): Extension) -> String { - format!( - "collab {mode:?} v{VERSION} ({})", - REVISION.unwrap_or("unknown") - ) + format!("zed:{mode} v{VERSION} ({})", REVISION.unwrap_or("unknown")) } async fn handle_liveness_probe(