mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-25 22:00:05 +00:00
fix: serialization of array containing a table
table in a (hetero-) array should be force-inlined
This commit is contained in:
parent
2c72329530
commit
45bd566f7a
@ -309,7 +309,17 @@ struct serializer
|
||||
continue;
|
||||
}
|
||||
std::string next_elem;
|
||||
next_elem += toml::visit(*this, item);
|
||||
if(item.is_table())
|
||||
{
|
||||
serializer ser(*this);
|
||||
ser.can_be_inlined_ = true;
|
||||
ser.width_ = std::numeric_limits<std::size_t>::max();
|
||||
next_elem += toml::visit(ser, item);
|
||||
}
|
||||
else
|
||||
{
|
||||
next_elem += toml::visit(*this, item);
|
||||
}
|
||||
|
||||
// comma before newline.
|
||||
if(!next_elem.empty() && next_elem.back() == '\n') {next_elem.pop_back();}
|
||||
|
Loading…
Reference in New Issue
Block a user