}
::rust::Vec<::rust::String> addresses;
stringtok(addresses, instructions, ",; ");
- ForwardZone forwardzone{domain, addresses, recurse, allowNotify};
+ ForwardZone forwardzone{domain, std::move(addresses), recurse, allowNotify};
vec.push_back(std::move(forwardzone));
}
}
mergeYamlSubFile(yamlfile, yamlstruct, false, log);
}
yamlstruct.validate();
- settings = yamlstruct;
+ settings = std::move(yamlstruct);
return YamlSettingsStatus::OK;
}
catch (const ::rust::Error& ex) {
auto data = string(std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>());
auto yamlvec = pdns::rust::settings::rec::parse_yaml_string_to_allow_from(data);
pdns::rust::settings::rec::validate_allow_from(filename, yamlvec);
- vec = yamlvec;
+ vec = std::move(yamlvec);
}
void pdns::settings::rec::readYamlForwardZonesFile(const std::string& filename, ::rust::Vec<pdns::rust::settings::rec::ForwardZone>& vec, Logr::log_t log)
auto data = string(std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>());
auto yamlvec = pdns::rust::settings::rec::parse_yaml_string_to_forward_zones(data);
pdns::rust::settings::rec::validate_forward_zones("forward_zones", yamlvec);
- vec = yamlvec;
+ vec = std::move(yamlvec);
}
void pdns::settings::rec::readYamlAllowNotifyForFile(const std::string& filename, ::rust::Vec<::rust::String>& vec, Logr::log_t log)
auto data = string(std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>());
auto yamlvec = pdns::rust::settings::rec::parse_yaml_string_to_allow_notify_for(data);
pdns::rust::settings::rec::validate_allow_notify_for("allow-notify-for", yamlvec);
- vec = yamlvec;
+ vec = std::move(yamlvec);
}
std::string pdns::settings::rec::to_arg(const AuthZone& authzone)
boost::trim(headers.second);
::rust::Vec<::rust::String> addresses;
stringtok(addresses, headers.second, " ;");
- ForwardZone forwardzone{headers.first, addresses, recurse, false};
+ ForwardZone forwardzone{headers.first, std::move(addresses), recurse, false};
field.push_back(std::move(forwardzone));
}
}
pdns::rust::settings::rec::Value rustvalue = {false, 0, 0.0, "", {}, {}, {}};
if (pdns::settings::rec::oldKVToBridgeStruct(var, val, section, fieldname, type_name, rustvalue)) {
auto overriding = !mainFile && !incremental && !simpleRustType(type_name);
- auto [existing, inserted] = map.emplace(std::pair{std::pair{section, fieldname}, pdns::rust::settings::rec::OldStyle{section, fieldname, var, type_name, rustvalue, overriding}});
+ auto [existing, inserted] = map.emplace(std::pair{std::pair{section, fieldname}, pdns::rust::settings::rec::OldStyle{section, fieldname, var, std::move(type_name), rustvalue, overriding}});
if (!inserted) {
// Simple values overwrite always
existing->second.value.bool_val = rustvalue.bool_val;
string name = var;
string val = arg().getDefault(var);
if (pdns::settings::rec::oldKVToBridgeStruct(name, val, section, fieldname, type_name, rustvalue)) {
- map.emplace(std::pair{std::pair{section, fieldname}, pdns::rust::settings::rec::OldStyle{section, fieldname, name, type_name, rustvalue, false}});
+ map.emplace(std::pair{std::pair{section, fieldname}, pdns::rust::settings::rec::OldStyle{section, fieldname, name, std::move(type_name), std::move(rustvalue), false}});
}
}
// Convert the map to a vector, as CXX does not have any dictionary like support.