File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed
crashtracker-ffi/src/collector_windows Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -265,18 +265,13 @@ pub unsafe extern "C" fn ddog_crasht_exception_event_callback(
265
265
for thread in threads. unwrap ( ) {
266
266
let stack_result = walk_thread_stack ( exception_information. hProcess , thread, & modules) ;
267
267
268
- let stack: StackTrace = if stack_result. is_err ( ) {
269
- output_debug_string (
270
- format ! (
271
- "Failed to walk thread stack: {}" ,
272
- stack_result. err( ) . unwrap( )
273
- )
274
- . as_str ( ) ,
275
- ) ;
276
- StackTrace :: new_incomplete ( )
277
- } else {
278
- stack_result. unwrap ( )
279
- } ;
268
+ let stack: StackTrace = stack_result. map_or_else (
269
+ |e| {
270
+ output_debug_string ( format ! ( "Failed to walk thread stack: {}" , e) . as_str ( ) ) ;
271
+ StackTrace :: new_incomplete ( )
272
+ } ,
273
+ |stack| stack,
274
+ ) ;
280
275
281
276
if thread == crash_tid {
282
277
builder
@@ -471,7 +466,7 @@ unsafe fn walk_thread_stack(
471
466
"{:x}" ,
472
467
native_frame. AddrPC . Offset - module. base_address
473
468
) ) ;
474
- frame. path = module. path . clone ( ) ;
469
+ frame. path . clone_from ( & module. path ) ;
475
470
476
471
if let Some ( pdb_info) = & module. pdb_info {
477
472
frame. build_id = Some ( format ! ( "{:x}{:x}" , pdb_info. signature, pdb_info. age) ) ;
You can’t perform that action at this time.
0 commit comments