Skip to main content

fit_description

Function fit_description 

Source
pub fn fit_description<const N: usize>(dst: &mut String<N>, text: &str) -> bool
Expand description

phase-446 F2 – store as much of text as dst holds, cut at a UTF-8 character boundary. Returns whether anything was cut.

heapless::String::push_str is all-or-nothing, so the old let _ = push_str(..) stored NOTHING for a description one byte too long. A prefix is what a reader of ros2 param describe can still use, and the true return is what lets the caller say it happened.