diff options
author | Blaž Hrastnik | 2022-11-04 12:01:17 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2022-11-04 12:06:28 +0000 |
commit | c2c1280f02b83a468da67d88350c199915427535 (patch) | |
tree | cd4306c1b7353bb960608e18c5633aa22c5d0204 /helix-lsp | |
parent | 921d3510132b0bd89d4ac0a542371c3ae90e2e02 (diff) |
Resolve a bunch of upcoming clippy lints
Diffstat (limited to 'helix-lsp')
-rw-r--r-- | helix-lsp/src/jsonrpc.rs | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/helix-lsp/src/jsonrpc.rs b/helix-lsp/src/jsonrpc.rs index b9b3fd2c..75ac9309 100644 --- a/helix-lsp/src/jsonrpc.rs +++ b/helix-lsp/src/jsonrpc.rs @@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; // https://www.jsonrpc.org/specification#error_object -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] pub enum ErrorCode { ParseError, InvalidRequest, @@ -68,7 +68,7 @@ impl Serialize for ErrorCode { } } -#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] pub struct Error { pub code: ErrorCode, pub message: String, @@ -100,7 +100,7 @@ impl std::error::Error for Error {} // https://www.jsonrpc.org/specification#request_object /// Request ID -#[derive(Debug, PartialEq, Clone, Hash, Eq, Deserialize, Serialize)] +#[derive(Debug, PartialEq, Eq, Clone, Hash, Deserialize, Serialize)] #[serde(untagged)] pub enum Id { Null, @@ -109,7 +109,7 @@ pub enum Id { } /// Protocol Version -#[derive(Debug, PartialEq, Clone, Copy, Hash, Eq)] +#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)] pub enum Version { V2, } @@ -153,7 +153,7 @@ impl<'de> Deserialize<'de> for Version { } } -#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum Params { None, @@ -182,7 +182,7 @@ impl From<Params> for Value { } } -#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] #[serde(deny_unknown_fields)] pub struct MethodCall { pub jsonrpc: Option<Version>, @@ -192,7 +192,7 @@ pub struct MethodCall { pub id: Id, } -#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] #[serde(deny_unknown_fields)] pub struct Notification { pub jsonrpc: Option<Version>, @@ -201,7 +201,7 @@ pub struct Notification { pub params: Params, } -#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] #[serde(deny_unknown_fields)] #[serde(untagged)] pub enum Call { @@ -235,7 +235,7 @@ impl From<Notification> for Call { } } -#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] #[serde(deny_unknown_fields)] #[serde(untagged)] pub enum Request { @@ -245,7 +245,7 @@ pub enum Request { // https://www.jsonrpc.org/specification#response_object -#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] pub struct Success { #[serde(skip_serializing_if = "Option::is_none")] pub jsonrpc: Option<Version>, @@ -253,7 +253,7 @@ pub struct Success { pub id: Id, } -#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] +#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] pub struct Failure { #[serde(skip_serializing_if = "Option::is_none")] pub jsonrpc: Option<Version>, @@ -264,7 +264,7 @@ pub struct Failure { // Note that failure comes first because we're not using // #[serde(deny_unknown_field)]: we want a request that contains // both `result` and `error` to be a `Failure`. -#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] +#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] #[serde(untagged)] pub enum Output { Failure(Failure), @@ -280,7 +280,7 @@ impl From<Output> for Result<Value, Error> { } } -#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] #[serde(untagged)] pub enum Response { Single(Output), |