Skip to content

Commit a9625da

Browse files
Apply stylistic suggestions from code review
Co-authored-by: Michael Davis <[email protected]>
1 parent 48f3396 commit a9625da

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

helix-core/src/syntax.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ pub struct Syntax {
719719

720720
impl fmt::Debug for Syntax {
721721
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
722-
// skip the layer_lut and layer_lut hasher here as they
722+
// skip the layer_lut and layer_lut hasher here as they do not implement Debug
723723
f.debug_struct("Syntax")
724724
.field("layers", &self.layers)
725725
.field("root", &self.root)
@@ -806,7 +806,7 @@ impl Syntax {
806806
// Ensure lut is large enough to hold all layers.
807807
// The lut should always be empty at this point because it is only
808808
// kept to avoid realloctions so rehashing is never requied (hence unreachable).
809-
assert_eq!(self.layers_lut.len(), 0);
809+
assert!(self.layers_lut.is_empty());
810810
self.layers_lut
811811
.reserve(self.layers.len(), |_| unreachable!());
812812

@@ -1190,7 +1190,7 @@ fn hash_injection_layer(
11901190
let mut state = state.build_hasher();
11911191
depth.hash(&mut state);
11921192
// The transmute is necessary here because tree_sitter::Language does not derive Hash at the moment.
1193-
// However it does use #[repr] transpraerent so the transmute here is save
1193+
// However it does use #[repr] transparent so the transmute here is safe
11941194
// as `Language` (which `Grammar` is an alias for) is just a newtype wrapper around a (thin) pointer.
11951195
// This is also compatible with the PartialEq implementation of language
11961196
// as that is just a pointer comparison.

0 commit comments

Comments
 (0)