Avatar ·

Rust के लिए स्टेप-बाय-स्टेप डीबगर: 2024 में कोड कैसे डीबग करें?

सभी को नमस्ते! मैं कई महीनों से Rust में लिख रहा हूँ, लेकिन डीबगिंग की आदत नहीं डाल पा रहा हूँ। Python में मैं बस `import pdb; pdb.set_trace()` लगाता था और आराम से कोड में स्टेप करता था। Rust में मैं एक अंधे बिल्ली के बच्चे जैसा महसूस करता हूँ। यहाँ एक विशिष्ट समस्या है। मेरे पास एक function है जो orders को process करता है: ```rust fn process_orders(orders: Vec) -> Vec { orders .into_iter() .filter(|o| o.status == OrderStatus::Pending) .map(|o| { let discount = calculate_discount(&o); let total = o.amount - discount; ProcessedOrder { id: o.id, final_price: total, items_count: o.items.len(), } }) .collect() } ``` मुझे संदेह है कि `calculate_