@@ -719,7 +719,7 @@ pub struct Syntax {
719
719
720
720
impl fmt:: Debug for Syntax {
721
721
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
723
723
f. debug_struct ( "Syntax" )
724
724
. field ( "layers" , & self . layers )
725
725
. field ( "root" , & self . root )
@@ -806,7 +806,7 @@ impl Syntax {
806
806
// Ensure lut is large enough to hold all layers.
807
807
// The lut should always be empty at this point because it is only
808
808
// 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 ( ) ) ;
810
810
self . layers_lut
811
811
. reserve ( self . layers . len ( ) , |_| unreachable ! ( ) ) ;
812
812
@@ -1190,7 +1190,7 @@ fn hash_injection_layer(
1190
1190
let mut state = state. build_hasher ( ) ;
1191
1191
depth. hash ( & mut state) ;
1192
1192
// 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
1194
1194
// as `Language` (which `Grammar` is an alias for) is just a newtype wrapper around a (thin) pointer.
1195
1195
// This is also compatible with the PartialEq implementation of language
1196
1196
// as that is just a pointer comparison.
0 commit comments