Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

cloud_llm_client: Add derives for edit prediction fields (#51968)

Neel0f1f0f9272b2
diff --git a/crates/cloud_llm_client/src/cloud_llm_client.rs b/crates/cloud_llm_client/src/cloud_llm_client.rs
index d2d25ff5b84..8c06bd7ebb1 100644
--- a/crates/cloud_llm_client/src/cloud_llm_client.rs
+++ b/crates/cloud_llm_client/src/cloud_llm_client.rs
@@ -111,7 +111,8 @@ pub struct PredictEditsBody {
pub trigger: PredictEditsRequestTrigger,
}
-#[derive(Default, Debug, Clone, Copy, Serialize, Deserialize)]
+#[derive(Default, Debug, Clone, Copy, Serialize, Deserialize, strum::AsRefStr)]
+#[strum(serialize_all = "snake_case")]
pub enum PredictEditsRequestTrigger {
Testing,
Diagnostics,
@@ -170,7 +171,10 @@ pub struct EditPredictionRejection {
pub e2e_latency_ms: Option<u128>,
}
-#[derive(Default, Debug, Clone, Copy, Serialize, Deserialize, PartialEq)]
+#[derive(
+ Default, Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Hash, strum::AsRefStr,
+)]
+#[strum(serialize_all = "snake_case")]
pub enum EditPredictionRejectReason {
/// New requests were triggered before this one completed
Canceled,