Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/proc-macro-api/src/process.rs')
| -rw-r--r-- | crates/proc-macro-api/src/process.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/crates/proc-macro-api/src/process.rs b/crates/proc-macro-api/src/process.rs index 7f0cd05c80..1365245f98 100644 --- a/crates/proc-macro-api/src/process.rs +++ b/crates/proc-macro-api/src/process.rs @@ -34,12 +34,6 @@ pub(crate) enum Protocol { Postcard { mode: SpanMode }, } -impl Default for Protocol { - fn default() -> Self { - Protocol::Postcard { mode: SpanMode::Id } - } -} - /// Maintains the state of the proc-macro server process. #[derive(Debug)] struct ProcessSrvState { @@ -122,11 +116,10 @@ impl ProcMacroServerProcess { srv.version = version; if version >= version::RUST_ANALYZER_SPAN_SUPPORT - && let Ok(mode) = srv.enable_rust_analyzer_spans() + && let Ok(new_mode) = srv.enable_rust_analyzer_spans() { - srv.protocol = match protocol { - Protocol::Postcard { .. } => Protocol::Postcard { mode }, - Protocol::LegacyJson { .. } => Protocol::LegacyJson { mode }, + match &mut srv.protocol { + Protocol::Postcard { mode } | Protocol::LegacyJson { mode } => *mode = new_mode, }; } |