@@ -243,10 +243,7 @@ fn compose_spec(fn_id: &str, idx: &TripleIndex) -> ActionSpec {
243243
244244 // `effects` must materialize as a Vec at the end, but we also iterate it
245245 // to drive `inputs` below — borrow the source set, then collect once.
246- let effects_set: & BTreeSet < String > = idx
247- . emits_by_fn
248- . get ( fn_id)
249- . unwrap_or ( & EMPTY_SET ) ;
246+ let effects_set: & BTreeSet < String > = idx. emits_by_fn . get ( fn_id) . unwrap_or ( & EMPTY_SET ) ;
250247
251248 let mut inputs: BTreeSet < String > = BTreeSet :: new ( ) ;
252249 for effect in effects_set {
@@ -270,8 +267,7 @@ fn compose_spec(fn_id: &str, idx: &TripleIndex) -> ActionSpec {
270267/// each element once (vs `.cloned().unwrap_or_default()` which clones the
271268/// entire tree before re-collecting).
272269fn collect_sorted ( set : Option < & BTreeSet < String > > ) -> Vec < String > {
273- set. map ( |s| s. iter ( ) . cloned ( ) . collect ( ) )
274- . unwrap_or_default ( )
270+ set. map ( |s| s. iter ( ) . cloned ( ) . collect ( ) ) . unwrap_or_default ( )
275271}
276272
277273/// Singleton empty set so `compose_spec` can borrow a reference for the
@@ -398,12 +394,15 @@ mod tests {
398394 ) ;
399395 assert_eq ! ( cm. raises, vec![ "exc:UserError" . to_string( ) ] ) ;
400396 assert_eq ! ( cm. reads, vec![ "odoo:account_move.currency_id" . to_string( ) ] ) ;
401- assert_eq ! (
402- cm. traverses,
403- vec![ "odoo:account_move.line_ids" . to_string( ) ]
397+ assert_eq ! ( cm. traverses, vec![ "odoo:account_move.line_ids" . to_string( ) ] ) ;
398+ assert ! (
399+ !cm. is_pure_compute( ) ,
400+ "raises non-empty disqualifies pure compute"
401+ ) ;
402+ assert ! (
403+ !cm. is_pure_guard( ) ,
404+ "effects non-empty disqualifies pure guard"
404405 ) ;
405- assert ! ( !cm. is_pure_compute( ) , "raises non-empty disqualifies pure compute" ) ;
406- assert ! ( !cm. is_pure_guard( ) , "effects non-empty disqualifies pure guard" ) ;
407406 assert ! ( !cm. is_trivial( ) ) ;
408407 }
409408
@@ -435,7 +434,11 @@ mod tests {
435434 fn emit_non_trivial_drops_empties ( ) {
436435 let mut t = fixture ( ) ;
437436 // Add a function with no edges at all.
438- t. push ( triple ( "odoo:account_move._stub" , "rdf:type" , "ogit:Function" ) ) ;
437+ t. push ( triple (
438+ "odoo:account_move._stub" ,
439+ "rdf:type" ,
440+ "ogit:Function" ,
441+ ) ) ;
439442
440443 let all = emit_actions ( & t) ;
441444 let non_trivial = emit_non_trivial_actions ( & t) ;
@@ -445,7 +448,9 @@ mod tests {
445448 "stub should appear in full output"
446449 ) ;
447450 assert ! (
448- !non_trivial. iter( ) . any( |s| s. id == "odoo:account_move._stub" ) ,
451+ !non_trivial
452+ . iter( )
453+ . any( |s| s. id == "odoo:account_move._stub" ) ,
449454 "stub should be filtered from non_trivial output"
450455 ) ;
451456 }
@@ -493,7 +498,10 @@ mod tests {
493498
494499 #[ test]
495500 fn family_of_handles_dotted_iri ( ) {
496- assert_eq ! ( family_of( "odoo:account_move._compute_amount" ) , "account_move" ) ;
501+ assert_eq ! (
502+ family_of( "odoo:account_move._compute_amount" ) ,
503+ "account_move"
504+ ) ;
497505 assert_eq ! ( family_of( "odoo:res_partner.name" ) , "res_partner" ) ;
498506 assert_eq ! ( family_of( "odoo:standalone" ) , "standalone" ) ;
499507 // No `odoo:` prefix — IRI returned as-is up to the first dot.
@@ -522,7 +530,10 @@ mod tests {
522530 triple( "odoo:m.unrelated" , "depends_on" , "odoo:m.something" ) ,
523531 ] ;
524532 let specs = emit_actions ( & triples) ;
525- let g = specs. iter ( ) . find ( |s| s. id == "odoo:m._guard" ) . expect ( "guard" ) ;
533+ let g = specs
534+ . iter ( )
535+ . find ( |s| s. id == "odoo:m._guard" )
536+ . expect ( "guard" ) ;
526537 assert ! ( g. effects. is_empty( ) , "no emitted_by ⇒ no effects" ) ;
527538 assert ! (
528539 g. inputs. is_empty( ) ,
0 commit comments