Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-lsp-types/src/lib.rs')
| -rw-r--r-- | helix-lsp-types/src/lib.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/helix-lsp-types/src/lib.rs b/helix-lsp-types/src/lib.rs index fd668de5..fa912f56 100644 --- a/helix-lsp-types/src/lib.rs +++ b/helix-lsp-types/src/lib.rs @@ -210,6 +210,16 @@ pub enum NumberOrString { Number(i32), String(String), } +impl From<i32> for NumberOrString { + fn from(v: i32) -> Self { + Self::Number(v) + } +} +impl From<&i32> for NumberOrString { + fn from(&v: &i32) -> Self { + Self::Number(v) + } +} /* ----------------- Cancel support ----------------- */ |