diff --git a/src/main.cpp b/src/main.cpp index 88a67e8..6806923 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,8 +3,8 @@ #include "days/days.h" -std::vector getInput(int day, std::string key, bool useTestInput) { - std::vector result; +Input getInput(int day, std::string key, bool useTestInput) { + Input input; char dayStrPadded[3]; sprintf(dayStrPadded, "%02u", day); @@ -13,7 +13,7 @@ std::vector getInput(int day, std::string key, bool useTestInput) { if (!std::filesystem::exists({localFilePath})) { if (key.empty()) - return result; + return input; std::string dayStr = std::to_string(day); std::string url = "https://adventofcode.com/2021/day/" + dayStr + "/input"; std::cout << "Input does not exist. Fetching from " + url << std::endl; @@ -26,11 +26,11 @@ std::vector getInput(int day, std::string key, bool useTestInput) { std::string line; while (std::getline(file, line)) - result.push_back(line); + input.push_back(line); file.close(); - return result; + return input; } std::string getSessionKey() {