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