about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNathan Vegdahl <cessen@cessen.com>2025-01-29 20:21:57 +0100
committerNathan Vegdahl <cessen@cessen.com>2025-01-29 20:21:57 +0100
commit7ffccb03468d5573da2b4ff2587e953346e05bf3 (patch)
treea32db324dc1464c7ccf1c6a7123f89c26d47cdf4 /src
parent615186586b76c831ddf3d9427f7e148f6b1c11bd (diff)
downloadrust-7ffccb03468d5573da2b4ff2587e953346e05bf3.tar.gz
rust-7ffccb03468d5573da2b4ff2587e953346e05bf3.zip
Use `to_ne_bytes` instead of `to_le_bytes`
Diffstat (limited to 'src')
-rw-r--r--src/tools/rust-analyzer/crates/rust-analyzer/src/lib.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/lib.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/lib.rs
index 0b459c10cee..c2ef03ecae8 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/lib.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/lib.rs
@@ -118,18 +118,18 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
         u8::from(item.trigger_call_info),
     ]);
 
-    hasher.update(item.label.primary.len().to_le_bytes());
+    hasher.update(item.label.primary.len().to_ne_bytes());
     hasher.update(&item.label.primary);
 
     hasher.update([u8::from(item.label.detail_left.is_some())]);
     if let Some(label_detail) = &item.label.detail_left {
-        hasher.update(label_detail.len().to_le_bytes());
+        hasher.update(label_detail.len().to_ne_bytes());
         hasher.update(label_detail);
     }
 
     hasher.update([u8::from(item.label.detail_right.is_some())]);
     if let Some(label_detail) = &item.label.detail_right {
-        hasher.update(label_detail.len().to_le_bytes());
+        hasher.update(label_detail.len().to_ne_bytes());
         hasher.update(label_detail);
     }
 
@@ -140,15 +140,15 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
     // while not really making completion properties more unique as they are already.
 
     let kind_tag = item.kind.tag();
-    hasher.update(kind_tag.len().to_le_bytes());
+    hasher.update(kind_tag.len().to_ne_bytes());
     hasher.update(kind_tag);
 
-    hasher.update(item.lookup.len().to_le_bytes());
+    hasher.update(item.lookup.len().to_ne_bytes());
     hasher.update(&item.lookup);
 
     hasher.update([u8::from(item.detail.is_some())]);
     if let Some(detail) = &item.detail {
-        hasher.update(detail.len().to_le_bytes());
+        hasher.update(detail.len().to_ne_bytes());
         hasher.update(detail);
     }
 
@@ -162,12 +162,12 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
             CompletionItemRefMode::Dereference => 2u8,
         };
         hasher.update([discriminant]);
-        hasher.update(u32::from(*text_size).to_le_bytes());
+        hasher.update(u32::from(*text_size).to_ne_bytes());
     }
 
-    hasher.update(item.import_to_add.len().to_le_bytes());
+    hasher.update(item.import_to_add.len().to_ne_bytes());
     for import_path in &item.import_to_add {
-        hasher.update(import_path.len().to_le_bytes());
+        hasher.update(import_path.len().to_ne_bytes());
         hasher.update(import_path);
     }