File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ impl SyscallInstruction {
163163 let buffer = memory. read_bytes ( buf_addr, count as _ ) ?;
164164
165165 if let Some ( logger) = logs {
166- logger. push ( buffer. clone ( ) ) ;
166+ logger. push ( buffer) ;
167167 } else {
168168 print ! ( "{}" , String :: from_utf8_lossy( & buffer) ) ;
169169 }
@@ -200,10 +200,11 @@ impl SyscallInstruction {
200200
201201 // Convert buffer to string and split it into marker and function name
202202 let label = String :: from_utf8_lossy ( & buf) . to_string ( ) ;
203- let ( marker, fn_name) = label
204- . split_once ( '#' )
205- . ok_or_else ( || VMErrorKind :: InvalidProfileLabel ( label. clone ( ) ) ) ?
206- . to_owned ( ) ;
203+ let ( marker, fn_name) = match label. split_once ( '#' ) {
204+ Some ( parts) => parts,
205+ None => return Err ( VMErrorKind :: InvalidProfileLabel ( label) ) ?,
206+ } ;
207+ let ( marker, fn_name) = ( marker. to_owned ( ) , fn_name. to_owned ( ) ) ;
207208
208209 // Ensure the marker is either '^' (start) or '$' (end)
209210 if !matches ! ( marker, "^" | "$" ) {
You can’t perform that action at this time.
0 commit comments