/* Fills the buffer with used material types Example: PLA Example XL: PLA,PETG,-,-,-  */
static void print_material_types(std::span< char > buffer, GCodeInfo &gcode)
/* Fills the buffer with used material types Example: PLA Example XL: PLA,PETG,-,-,-  */
static void print_material_types(std::span< char > buffer, GCodeInfo &gcode)
{
        const auto &extruder_info = gcode.get_extruder_info(extruder);
        const auto &filament_name = extruder_info.filament_name;
        if (extruder_info.used() && filament_name.has_value()) {
            return snprintf(item_buffer.data(), item_buffer.size(), "%s", filament_name.value().begin());
        } else if (extruder_info.used()) {
            return snprintf(item_buffer.data(), item_buffer.size(), "%s", "?");
        } else {
            return snprintf(item_buffer.data(), item_buffer.size(), "%s", "-");
        }
    });
}