Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 4b8e4d4

Browse files
committed
Rename request_id_to_method to request_id_to_method_map
... for uniformity
1 parent 93bf1cb commit 4b8e4d4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/lsps0/msgs.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ impl LSPSMessage {
191191
/// The given `request_id_to_method` associates request ids with method names, as response objects
192192
/// don't carry the latter.
193193
pub fn from_str_with_id_map(
194-
json_str: &str, request_id_to_method: &mut HashMap<String, String>,
194+
json_str: &str, request_id_to_method_map: &mut HashMap<String, String>,
195195
) -> Result<Self, serde_json::Error> {
196196
let deserializer = &mut serde_json::Deserializer::from_str(json_str);
197-
let visitor = LSPSMessageVisitor { request_id_to_method };
197+
let visitor = LSPSMessageVisitor { request_id_to_method_map };
198198
deserializer.deserialize_any(visitor)
199199
}
200200

@@ -336,7 +336,7 @@ impl Serialize for LSPSMessage {
336336
}
337337

338338
struct LSPSMessageVisitor<'a> {
339-
request_id_to_method: &'a mut HashMap<String, String>,
339+
request_id_to_method_map: &'a mut HashMap<String, String>,
340340
}
341341

342342
impl<'de, 'a> Visitor<'de> for LSPSMessageVisitor<'a> {
@@ -390,7 +390,7 @@ impl<'de, 'a> Visitor<'de> for LSPSMessageVisitor<'a> {
390390
match method {
391391
Some(method) => match method {
392392
LSPS0_LISTPROTOCOLS_METHOD_NAME => {
393-
self.request_id_to_method.insert(id.clone(), method.to_string());
393+
self.request_id_to_method_map.insert(id.clone(), method.to_string());
394394

395395
Ok(LSPSMessage::LSPS0(LSPS0Message::Request(
396396
RequestId(id),
@@ -445,7 +445,7 @@ impl<'de, 'a> Visitor<'de> for LSPSMessageVisitor<'a> {
445445
method
446446
))),
447447
},
448-
None => match self.request_id_to_method.get(&id) {
448+
None => match self.request_id_to_method_map.get(&id) {
449449
Some(method) => match method.as_str() {
450450
LSPS0_LISTPROTOCOLS_METHOD_NAME => {
451451
if let Some(error) = error {

0 commit comments

Comments
 (0)