@@ -67,9 +67,9 @@ impl<'a> StatementInjectorStore<'a> {
6767
6868 /// Add a statement to be inserted immediately before the target statement.
6969 #[ expect( dead_code) ]
70- pub fn insert_before ( & self , target : Address , stmt : Statement < ' a > ) {
70+ pub fn insert_before ( & self , target : & Statement < ' a > , stmt : Statement < ' a > ) {
7171 let mut insertions = self . insertions . borrow_mut ( ) ;
72- let adjacent_stmts = insertions. entry ( target) . or_default ( ) ;
72+ let adjacent_stmts = insertions. entry ( target. address ( ) ) . or_default ( ) ;
7373 let index = adjacent_stmts
7474 . iter ( )
7575 . position ( |s| matches ! ( s. direction, Direction :: After ) )
@@ -79,33 +79,33 @@ impl<'a> StatementInjectorStore<'a> {
7979
8080 /// Add a statement to be inserted immediately after the target statement.
8181 #[ expect( dead_code) ]
82- pub fn insert_after ( & self , target : Address , stmt : Statement < ' a > ) {
82+ pub fn insert_after ( & self , target : & Statement < ' a > , stmt : Statement < ' a > ) {
8383 let mut insertions = self . insertions . borrow_mut ( ) ;
84- let adjacent_stmts = insertions. entry ( target) . or_default ( ) ;
84+ let adjacent_stmts = insertions. entry ( target. address ( ) ) . or_default ( ) ;
8585 adjacent_stmts. push ( AdjacentStatement { stmt, direction : Direction :: After } ) ;
8686 }
8787
8888 /// Add multiple statements to be inserted immediately before the target statement.
8989 #[ expect( dead_code) ]
90- pub fn insert_many_before < S > ( & self , target : Address , stmts : S )
90+ pub fn insert_many_before < S > ( & self , target : & Statement < ' a > , stmts : S )
9191 where
9292 S : IntoIterator < Item = Statement < ' a > > ,
9393 {
9494 let mut insertions = self . insertions . borrow_mut ( ) ;
95- let adjacent_stmts = insertions. entry ( target) . or_default ( ) ;
95+ let adjacent_stmts = insertions. entry ( target. address ( ) ) . or_default ( ) ;
9696 adjacent_stmts. splice (
9797 0 ..0 ,
9898 stmts. into_iter ( ) . map ( |stmt| AdjacentStatement { stmt, direction : Direction :: Before } ) ,
9999 ) ;
100100 }
101101
102102 /// Add multiple statements to be inserted immediately after the target statement.
103- pub fn insert_many_after < S > ( & self , target : Address , stmts : S )
103+ pub fn insert_many_after < S > ( & self , target : & Statement < ' a > , stmts : S )
104104 where
105105 S : IntoIterator < Item = Statement < ' a > > ,
106106 {
107107 let mut insertions = self . insertions . borrow_mut ( ) ;
108- let adjacent_stmts = insertions. entry ( target) . or_default ( ) ;
108+ let adjacent_stmts = insertions. entry ( target. address ( ) ) . or_default ( ) ;
109109 adjacent_stmts. extend (
110110 stmts. into_iter ( ) . map ( |stmt| AdjacentStatement { stmt, direction : Direction :: After } ) ,
111111 ) ;
0 commit comments