@@ -51,8 +51,8 @@ pub struct SensitiveScriptSequence {
5151 pub transactions : VecDeque < SensitiveTransactionMetadata > ,
5252}
5353
54- impl From < ScriptSequence > for SensitiveScriptSequence {
55- fn from ( sequence : ScriptSequence ) -> Self {
54+ impl From < & ScriptSequence > for SensitiveScriptSequence {
55+ fn from ( sequence : & ScriptSequence ) -> Self {
5656 Self {
5757 transactions : sequence
5858 . transactions
@@ -99,31 +99,31 @@ impl ScriptSequence {
9999 return Ok ( ( ) ) ;
100100 }
101101
102- let Some ( ( path, sensitive_path) ) = self . paths . clone ( ) else { return Ok ( ( ) ) } ;
103-
104102 self . timestamp = now ( ) . as_millis ( ) ;
105103 let ts_name = format ! ( "run-{}.json" , self . timestamp) ;
106104
107- let sensitive_script_sequence: SensitiveScriptSequence = self . clone ( ) . into ( ) ;
105+ let sensitive_script_sequence = SensitiveScriptSequence :: from ( & * self ) ;
106+
107+ let Some ( ( path, sensitive_path) ) = self . paths . as_ref ( ) else { return Ok ( ( ) ) } ;
108108
109109 // broadcast folder writes
110110 //../run-latest.json
111- let mut writer = BufWriter :: new ( fs:: create_file ( & path) ?) ;
111+ let mut writer = BufWriter :: new ( fs:: create_file ( path) ?) ;
112112 serde_json:: to_writer_pretty ( & mut writer, & self ) ?;
113113 writer. flush ( ) ?;
114114 if save_ts {
115115 //../run-[timestamp].json
116- fs:: copy ( & path, path. with_file_name ( & ts_name) ) ?;
116+ fs:: copy ( path, path. with_file_name ( & ts_name) ) ?;
117117 }
118118
119119 // cache folder writes
120120 //../run-latest.json
121- let mut writer = BufWriter :: new ( fs:: create_file ( & sensitive_path) ?) ;
121+ let mut writer = BufWriter :: new ( fs:: create_file ( sensitive_path) ?) ;
122122 serde_json:: to_writer_pretty ( & mut writer, & sensitive_script_sequence) ?;
123123 writer. flush ( ) ?;
124124 if save_ts {
125125 //../run-[timestamp].json
126- fs:: copy ( & sensitive_path, sensitive_path. with_file_name ( & ts_name) ) ?;
126+ fs:: copy ( sensitive_path, sensitive_path. with_file_name ( & ts_name) ) ?;
127127 }
128128
129129 if !silent {
0 commit comments