Debugging
摘要
This chapter provides a comprehensive look at debugging in Rust, equipping you with both foundational and advanced techniques to identify and resolve issues effectively. It begins with the dbg! macro, a simple yet powerful tool for inspecting values during development without disrupting code flow. The discussion then turns to the standard error stream, explaining how Rust separates normal output from diagnostic messages for cleaner debugging. We next explore the Debug trait, which provides structured and human-readable representations of data for inspection.