mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 02:08:09 +08:00
test: use find instead of get<T>(v.at(""))
This commit is contained in:
@@ -20,7 +20,7 @@ BOOST_AUTO_TEST_CASE(test_example)
|
|||||||
|
|
||||||
auto serialized = toml::parse("tmp1.toml");
|
auto serialized = toml::parse("tmp1.toml");
|
||||||
{
|
{
|
||||||
auto& owner = toml::get<toml::table>(serialized.at("owner"));
|
auto& owner = toml::find<toml::table>(serialized, "owner");
|
||||||
auto& bio = toml::get<std::string>(owner.at("bio"));
|
auto& bio = toml::get<std::string>(owner.at("bio"));
|
||||||
const auto CR = std::find(bio.begin(), bio.end(), '\r');
|
const auto CR = std::find(bio.begin(), bio.end(), '\r');
|
||||||
if(CR != bio.end())
|
if(CR != bio.end())
|
||||||
|
Reference in New Issue
Block a user