@@ -71,8 +71,12 @@ pub(crate) fn print(
dynamic_value::Reader::UInt16(x) => formatter.write_fmt(format_args!("{x}")),
dynamic_value::Reader::UInt32(x) => formatter.write_fmt(format_args!("{x}")),
dynamic_value::Reader::UInt64(x) => formatter.write_fmt(format_args!("{x}")),
+ #[cfg(not(feature = "kernel"))]
dynamic_value::Reader::Float32(x) => formatter.write_fmt(format_args!("{x}")),
+ #[cfg(not(feature = "kernel"))]
dynamic_value::Reader::Float64(x) => formatter.write_fmt(format_args!("{x}")),
+ #[cfg(feature = "kernel")]
+ dynamic_value::Reader::Float32(_) | dynamic_value::Reader::Float64(_) => Err(fmt::Error),
dynamic_value::Reader::Enum(e) => match cvt(e.get_enumerant())? {
Some(enumerant) => {
formatter.write_str(cvt(cvt(enumerant.get_proto().get_name())?.to_str())?)
The kernel doesn't support floating point values, so return an error when the kernel feature is enabled. Signed-off-by: Ariel Miculas <amiculas@cisco.com> --- rust/capnp/stringify.rs | 4 ++++ 1 file changed, 4 insertions(+)