Rust:formatting specifier missing 错误解决方法
编译Rust程序时,出现 formatting specifier missing
错误,导致该错误的原因可能是错误的使用了 println!
宏;
错误的示范
fn main() {
let number:u32= 666;
println!("hello word ",number);
}
这段代码会造成 formatting specifier missing
错误,尝试打印number时,并没有为该变量添加格式说明符;
正确的用法
fn main() {
let number:u32= 666;
println!("hello word {}",number);
}
如需转载,请注明出处;本文地址:https://www.perfcode.com/p/formatting-specifier-missing.html