diff --git a/src/cgi.cpp b/src/cgi.cpp index cc104ae..bb0a103 100644 --- a/src/cgi.cpp +++ b/src/cgi.cpp @@ -37,14 +37,14 @@ using std::vector; entry_type parse_formdata() { - entry_type answer; + entry_type entry; try { cgicc::Cgicc cgi; - answer.instance = cgi("instance"); - answer.tags = string_to_array(cgi("tags")); - answer.receipts = string_to_array(cgi("receipts")); - answer.description = cgi("description"); + entry.instance = cgi("instance"); + entry.tags = string_to_vector(cgi("tags")); + entry.receipts = string_to_vector(cgi("receipts")); + entry.description = cgi("description"); } catch (const exception &e) { @@ -52,12 +52,12 @@ entry_type parse_formdata() // TODO: Error handling. } - return answer; + return entry; } -vector string_to_array(const string_view str) +vector string_to_vector(const string_view str) { - vector output; + vector vec; try { @@ -66,7 +66,7 @@ vector string_to_array(const string_view str) while (getline(input, element, ',')) { - output.push_back(element); + vec.push_back(element); } } catch (const exception &e) @@ -74,7 +74,7 @@ vector string_to_array(const string_view str) cerr << e.what() << '\n'; } - return output; + return vec; } } // namespace FediBlock diff --git a/src/cgi.hpp b/src/cgi.hpp index 96e251c..ed48583 100644 --- a/src/cgi.hpp +++ b/src/cgi.hpp @@ -40,7 +40,7 @@ struct entry_type [[nodiscard]] entry_type parse_formdata(); // Split a string at commas, return a vector. -[[nodiscard]] vector string_to_array(string_view str); +[[nodiscard]] vector string_to_vector(string_view str); } // namespace FediBlock diff --git a/src/json.hpp b/src/json.hpp index a9f7abb..ac08e35 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -26,7 +26,7 @@ namespace FediBlock using std::string; -// Convert our object into a JSON string. +// Convert an entry_type into a JSON string. [[nodiscard]] string to_json(const entry_type &entry); } // namespace FediBlock