Skip to content

Commit 7ffccb0

Browse files
committed
Use to_ne_bytes instead of to_le_bytes
1 parent 6151865 commit 7ffccb0

File tree

1 file changed

+9
-9
lines changed
  • src/tools/rust-analyzer/crates/rust-analyzer/src

1 file changed

+9
-9
lines changed

src/tools/rust-analyzer/crates/rust-analyzer/src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,18 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
118118
u8::from(item.trigger_call_info),
119119
]);
120120

121-
hasher.update(item.label.primary.len().to_le_bytes());
121+
hasher.update(item.label.primary.len().to_ne_bytes());
122122
hasher.update(&item.label.primary);
123123

124124
hasher.update([u8::from(item.label.detail_left.is_some())]);
125125
if let Some(label_detail) = &item.label.detail_left {
126-
hasher.update(label_detail.len().to_le_bytes());
126+
hasher.update(label_detail.len().to_ne_bytes());
127127
hasher.update(label_detail);
128128
}
129129

130130
hasher.update([u8::from(item.label.detail_right.is_some())]);
131131
if let Some(label_detail) = &item.label.detail_right {
132-
hasher.update(label_detail.len().to_le_bytes());
132+
hasher.update(label_detail.len().to_ne_bytes());
133133
hasher.update(label_detail);
134134
}
135135

@@ -140,15 +140,15 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
140140
// while not really making completion properties more unique as they are already.
141141

142142
let kind_tag = item.kind.tag();
143-
hasher.update(kind_tag.len().to_le_bytes());
143+
hasher.update(kind_tag.len().to_ne_bytes());
144144
hasher.update(kind_tag);
145145

146-
hasher.update(item.lookup.len().to_le_bytes());
146+
hasher.update(item.lookup.len().to_ne_bytes());
147147
hasher.update(&item.lookup);
148148

149149
hasher.update([u8::from(item.detail.is_some())]);
150150
if let Some(detail) = &item.detail {
151-
hasher.update(detail.len().to_le_bytes());
151+
hasher.update(detail.len().to_ne_bytes());
152152
hasher.update(detail);
153153
}
154154

@@ -162,12 +162,12 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
162162
CompletionItemRefMode::Dereference => 2u8,
163163
};
164164
hasher.update([discriminant]);
165-
hasher.update(u32::from(*text_size).to_le_bytes());
165+
hasher.update(u32::from(*text_size).to_ne_bytes());
166166
}
167167

168-
hasher.update(item.import_to_add.len().to_le_bytes());
168+
hasher.update(item.import_to_add.len().to_ne_bytes());
169169
for import_path in &item.import_to_add {
170-
hasher.update(import_path.len().to_le_bytes());
170+
hasher.update(import_path.len().to_ne_bytes());
171171
hasher.update(import_path);
172172
}
173173

0 commit comments

Comments
 (0)