Unnamed repository; edit this file 'description' to name the repository.
impl structuraleq
| -rw-r--r-- | helix-lsp-types/src/code_action.rs | 10 | ||||
| -rw-r--r-- | helix-lsp-types/src/lib.rs | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/helix-lsp-types/src/code_action.rs b/helix-lsp-types/src/code_action.rs index 93633c2d..ed9532f0 100644 --- a/helix-lsp-types/src/code_action.rs +++ b/helix-lsp-types/src/code_action.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; -use std::{borrow::Cow, ops::DerefPure}; +use std::{borrow::Cow, marker::StructuralPartialEq, ops::DerefPure}; #[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] #[serde(untagged)] pub enum CodeActionProviderCapability { @@ -149,7 +149,7 @@ impl From<CodeAction> for CodeActionOrCommand { } } -#[derive(Debug, Eq, PartialEq, Hash, PartialOrd, Clone, Deserialize, Serialize)] +#[derive(Debug, Eq, PartialOrd, Hash, Clone, Deserialize, Serialize)] pub struct CodeActionKind(pub Cow<'static, str>); impl std::ops::Deref for CodeActionKind { @@ -159,6 +159,12 @@ impl std::ops::Deref for CodeActionKind { self.as_str() } } +impl PartialEq for CodeActionKind { + fn eq(&self, other: &Self) -> bool { + self.0 == other.0 + } +} +impl StructuralPartialEq for CodeActionKind {} unsafe impl DerefPure for CodeActionKind {} impl CodeActionKind { diff --git a/helix-lsp-types/src/lib.rs b/helix-lsp-types/src/lib.rs index 32bfb282..d7202e29 100644 --- a/helix-lsp-types/src/lib.rs +++ b/helix-lsp-types/src/lib.rs @@ -15,7 +15,7 @@ able to parse any URI, such as `urn:isbn:0451450523`. */ #![allow(non_upper_case_globals)] -#![feature(deref_pure_trait)] +#![feature(deref_pure_trait, structural_match)] use bitflags::bitflags; use std::{collections::HashMap, fmt::Debug}; |