@@ -194,15 +194,15 @@ impl HookSubscriptionBitsetView {
194194 pub ( super ) fn compiler ( bitset : Buffer ) -> Self {
195195 Self :: new (
196196 bitset,
197- COMPILER_HOOK_SUBSCRIPTION_BITSET_BYTE_LENGTH ,
197+ COMPILER_HOOK_SUBSCRIPTION_BITSET_BYTE_LENGTH as usize ,
198198 "compiler hook subscription bitset length mismatch" ,
199199 )
200200 }
201201
202202 pub ( super ) fn compilation ( bitset : Buffer ) -> Self {
203203 Self :: new (
204204 bitset,
205- COMPILATION_HOOK_SUBSCRIPTION_BITSET_BYTE_LENGTH ,
205+ COMPILATION_HOOK_SUBSCRIPTION_BITSET_BYTE_LENGTH as usize ,
206206 "compilation hook subscription bitset length mismatch" ,
207207 )
208208 }
@@ -430,6 +430,10 @@ pub enum CompilerHooks {
430430
431431const COMPILER_HOOK_COUNT : usize = ( CompilerHooks :: AssetEmitted as usize ) + 1 ;
432432
433+ #[ napi]
434+ pub const COMPILER_HOOK_SUBSCRIPTION_BITSET_BYTE_LENGTH : u32 =
435+ ( ( COMPILER_HOOK_COUNT as u32 - 1 ) >> 3 ) + 1 ;
436+
433437#[ napi]
434438#[ repr( u8 ) ]
435439#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
@@ -481,18 +485,9 @@ pub enum CompilationHooks {
481485
482486const COMPILATION_HOOK_COUNT : usize = ( CompilationHooks :: RsdoctorPluginAssets as usize ) + 1 ;
483487
484- const fn hook_subscription_bitset_byte_length ( kind_count : usize ) -> usize {
485- if kind_count == 0 {
486- return 0 ;
487- }
488- ( ( kind_count - 1 ) >> 3 ) + 1
489- }
490-
491- const COMPILER_HOOK_SUBSCRIPTION_BITSET_BYTE_LENGTH : usize =
492- hook_subscription_bitset_byte_length ( COMPILER_HOOK_COUNT ) ;
493-
494- const COMPILATION_HOOK_SUBSCRIPTION_BITSET_BYTE_LENGTH : usize =
495- hook_subscription_bitset_byte_length ( COMPILATION_HOOK_COUNT ) ;
488+ #[ napi]
489+ pub const COMPILATION_HOOK_SUBSCRIPTION_BITSET_BYTE_LENGTH : u32 =
490+ ( ( COMPILATION_HOOK_COUNT as u32 - 1 ) >> 3 ) + 1 ;
496491
497492#[ derive( Clone ) ]
498493#[ napi( object, object_to_js = false ) ]
0 commit comments