@@ -401,12 +401,12 @@ impl QueryEngine {
401401 pos = end;
402402 chunks_done += 1 ;
403403
404- if chunks_done % 10 == 0 && pos < total {
404+ if chunks_done. is_multiple_of ( 10 ) && pos < total {
405405 tracing:: info!( "[QueryEngine] Embedded {}/{} symbols" , pos, total) ;
406406 }
407407
408408 // RAM backpressure: shed batch size under memory pressure.
409- let pressured = chunks_done % EMBED_MEM_CHECK_CHUNKS == 0
409+ let pressured = chunks_done. is_multiple_of ( EMBED_MEM_CHECK_CHUNKS )
410410 && embed_memory_pressured ( available_memory_mb ( ) ) ;
411411 if pressured && chunk_size > 4 {
412412 chunk_size = ( chunk_size / 2 ) . max ( 4 ) ;
@@ -555,7 +555,7 @@ impl QueryEngine {
555555 pos = end;
556556 chunks_done += 1 ;
557557
558- let pressured = chunks_done % EMBED_MEM_CHECK_CHUNKS == 0
558+ let pressured = chunks_done. is_multiple_of ( EMBED_MEM_CHECK_CHUNKS )
559559 && embed_memory_pressured ( available_memory_mb ( ) ) ;
560560 if pressured && chunk_size > 4 {
561561 chunk_size = ( chunk_size / 2 ) . max ( 4 ) ;
@@ -3991,7 +3991,10 @@ mod tests {
39913991
39923992 #[ test]
39933993 fn split_identifier_words_handles_camel_and_snake ( ) {
3994- assert_eq ! ( split_identifier_words( "authenticate_user" ) , "authenticate user" ) ;
3994+ assert_eq ! (
3995+ split_identifier_words( "authenticate_user" ) ,
3996+ "authenticate user"
3997+ ) ;
39953998 assert_eq ! ( split_identifier_words( "getUserById" ) , "get user by id" ) ;
39963999 // The existing tokenizer keeps acronym+word runs joined (HTML|Parser is
39974000 // NOT split) and drops 1-char tokens — known limitations worth revisiting
@@ -4013,11 +4016,13 @@ mod tests {
40134016 // Enabled: split name words are front-loaded for the static embedder.
40144017 let with_split =
40154018 QueryEngine :: build_embed_text ( & node, 0 , "getUserById" , false , true , & graph) ;
4016- assert ! ( with_split. starts_with( "get user by id" ) , "got: {with_split}" ) ;
4019+ assert ! (
4020+ with_split. starts_with( "get user by id" ) ,
4021+ "got: {with_split}"
4022+ ) ;
40174023
40184024 // Disabled (default): original transformer-path text is unchanged.
4019- let without =
4020- QueryEngine :: build_embed_text ( & node, 0 , "getUserById" , false , false , & graph) ;
4025+ let without = QueryEngine :: build_embed_text ( & node, 0 , "getUserById" , false , false , & graph) ;
40214026 assert ! ( without. starts_with( "getUserById" ) , "got: {without}" ) ;
40224027 assert ! ( !without. contains( "get user by id" ) ) ;
40234028 }
0 commit comments