@@ -49,7 +49,7 @@ ParseResult ConfigReader::ProcessOptionValue(
4949 case options_parser::OptionType::kBoolean : {
5050 bool result;
5151 if (option_value->get_bool ().get (result)) {
52- FPrintF (stderr, " Invalid value for %s\n " , option_name. c_str () );
52+ FPrintF (stderr, " Invalid value for %s\n " , option_name);
5353 return ParseResult::InvalidContent;
5454 }
5555
@@ -75,13 +75,13 @@ ParseResult ConfigReader::ProcessOptionValue(
7575 std::vector<std::string> result;
7676 simdjson::ondemand::array raw_imports;
7777 if (option_value->get_array ().get (raw_imports)) {
78- FPrintF (stderr, " Invalid value for %s\n " , option_name. c_str () );
78+ FPrintF (stderr, " Invalid value for %s\n " , option_name);
7979 return ParseResult::InvalidContent;
8080 }
8181 for (auto raw_import : raw_imports) {
8282 std::string_view import ;
8383 if (raw_import.get_string (import )) {
84- FPrintF (stderr, " Invalid value for %s\n " , option_name. c_str () );
84+ FPrintF (stderr, " Invalid value for %s\n " , option_name);
8585 return ParseResult::InvalidContent;
8686 }
8787 output->push_back (option_name + " =" + std::string (import ));
@@ -91,22 +91,22 @@ ParseResult ConfigReader::ProcessOptionValue(
9191 case simdjson::ondemand::json_type::string: {
9292 std::string result;
9393 if (option_value->get_string (result)) {
94- FPrintF (stderr, " Invalid value for %s\n " , option_name. c_str () );
94+ FPrintF (stderr, " Invalid value for %s\n " , option_name);
9595 return ParseResult::InvalidContent;
9696 }
9797 output->push_back (option_name + " =" + result);
9898 break ;
9999 }
100100 default :
101- FPrintF (stderr, " Invalid value for %s\n " , option_name. c_str () );
101+ FPrintF (stderr, " Invalid value for %s\n " , option_name);
102102 return ParseResult::InvalidContent;
103103 }
104104 break ;
105105 }
106106 case options_parser::OptionType::kString : {
107107 std::string result;
108108 if (option_value->get_string (result)) {
109- FPrintF (stderr, " Invalid value for %s\n " , option_name. c_str () );
109+ FPrintF (stderr, " Invalid value for %s\n " , option_name);
110110 return ParseResult::InvalidContent;
111111 }
112112 output->push_back (option_name + " =" + result);
@@ -115,7 +115,7 @@ ParseResult ConfigReader::ProcessOptionValue(
115115 case options_parser::OptionType::kInteger : {
116116 int64_t result;
117117 if (option_value->get_int64 ().get (result)) {
118- FPrintF (stderr, " Invalid value for %s\n " , option_name. c_str () );
118+ FPrintF (stderr, " Invalid value for %s\n " , option_name);
119119 return ParseResult::InvalidContent;
120120 }
121121 output->push_back (option_name + " =" + std::to_string (result));
@@ -125,22 +125,19 @@ ParseResult ConfigReader::ProcessOptionValue(
125125 case options_parser::OptionType::kUInteger : {
126126 uint64_t result;
127127 if (option_value->get_uint64 ().get (result)) {
128- FPrintF (stderr, " Invalid value for %s\n " , option_name. c_str () );
128+ FPrintF (stderr, " Invalid value for %s\n " , option_name);
129129 return ParseResult::InvalidContent;
130130 }
131131 output->push_back (option_name + " =" + std::to_string (result));
132132 break ;
133133 }
134134 case options_parser::OptionType::kNoOp : {
135- FPrintF (stderr,
136- " No-op flag %s is currently not supported\n " ,
137- option_name.c_str ());
135+ FPrintF (
136+ stderr, " No-op flag %s is currently not supported\n " , option_name);
138137 return ParseResult::InvalidContent;
139138 }
140139 case options_parser::OptionType::kV8Option : {
141- FPrintF (stderr,
142- " V8 flag %s is currently not supported\n " ,
143- option_name.c_str ());
140+ FPrintF (stderr, " V8 flag %s is currently not supported\n " , option_name);
144141 return ParseResult::InvalidContent;
145142 }
146143 default :
@@ -189,8 +186,7 @@ ParseResult ConfigReader::ParseOptions(
189186 if (option != options_map.end ()) {
190187 // If the option has already been set, return an error
191188 if (unique_options->contains (option->first )) {
192- FPrintF (
193- stderr, " Option %s is already defined\n " , option->first .c_str ());
189+ FPrintF (stderr, " Option %s is already defined\n " , option->first );
194190 return ParseResult::InvalidContent;
195191 }
196192 // Add the option to the unique set to prevent duplicates
@@ -206,7 +202,7 @@ ParseResult ConfigReader::ParseOptions(
206202 FPrintF (stderr,
207203 " Unknown or not allowed option %s for namespace %s\n " ,
208204 option_key,
209- namespace_name. c_str () );
205+ namespace_name);
210206 return ParseResult::InvalidContent;
211207 }
212208 }
@@ -303,7 +299,7 @@ ParseResult ConfigReader::ParseConfig(const std::string_view& config_path) {
303299 if (field_error) {
304300 FPrintF (stderr,
305301 " \" %s\" value unexpected for %s (should be an object)\n " ,
306- namespace_name. c_str () ,
302+ namespace_name,
307303 config_path.data ());
308304 return ParseResult::InvalidContent;
309305 }
0 commit comments