Skip to content

Commit

Permalink
Fix minor issues (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardGomezEscandell authored Dec 5, 2023
2 parents 1dcaaf4 + ab46e6d commit 0daa59f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion 2023/solvelib/04/day04.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <format>
#include <functional>
#include <numeric>
#include <ranges>
#include <stdexcept>
#include <string_view>
#include <vector>
Expand Down
8 changes: 6 additions & 2 deletions 2023/xmaslib/solution/solution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ solution::duration solution::time() const {
}

bool solution::run(bool verbose) noexcept {
if(verbose)
bool success = true;

if (verbose)
xlog::info("Day {}", this->day());

try {
Expand All @@ -42,6 +44,7 @@ bool solution::run(bool verbose) noexcept {
}
} catch (std::runtime_error &err) {
xlog::error("Part 1 failed with message: {}", err.what());
success = false;
} catch (...) {
xlog::error("Part 1 failed with no message");
return false;
Expand All @@ -60,12 +63,13 @@ bool solution::run(bool verbose) noexcept {
}
} catch (std::runtime_error &err) {
xlog::error("Part 2 failed with message: {}", err.what());
success = false;
} catch (...) {
xlog::error("Part 2 failed with no message");
return false;
}

return true;
return success;
}

void solution::set_input(std::string_view path) { this->data_path = path; }
Expand Down

0 comments on commit 0daa59f

Please sign in to comment.