本页尚未翻译,以下为英文原文。
#E0088: invalid format
An f-string hole formats a value that does not support the format ({} needs Display, {:?} needs Debug), or its format spec is not valid. Implement or derive the trait, or change the spec.
nabi
let name = "nabi";
println(f"{name:x}");
error[E0088]: format type `x` needs an integer, found `str` --> main.nabi:2:12 | 2 | println(f"{name:x}"); | ^^^^
Use a format that fits the value:
nabi
let n = 255;
println(f"{n:x}");
ff
Related: E0008 malformed f-string, E0069 trait bound not satisfied
Found a mistake? Edit this page on GitHub. Last updated