【发布时间】:2021-11-05 11:36:39
【问题描述】:
我有mymod.rs:
pub mod mymod {
#[derive(Debug)]
pub struct mystruct {
pub x: i32,
}
}
还有main.rs:
mod mymod;
use mymod::mymod::mystruct;
fn main() {
let x = mystruct { x: 10 };
println!("{:#?}", x);
}
输出是:
mystruct {
x: 10,
}
我可以让它显示以下文字吗:
mymod::mymod::mystruct {
x: 10,
}
?
【问题讨论】:
-
不是你想要的,但要注意
dbg!存在