Skip to content

Commit

Permalink
resolve minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jbbjarnason committed May 17, 2024
1 parent 1c581c3 commit 6f560ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion libs/confman/src/file_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ auto write_and_apply_retention_policy(std::string_view file_content, std::filesy
/// \param file_contents contents of the file
/// \returns A std::error_code indicating success or failure. If write fails, IO error is returned.
auto write_to_file(std::filesystem::path const& file_path, std::string_view file_contents) -> std::error_code {
auto glz_err{ glz::buffer_to_file(file_contents, file_path) };
auto glz_err{ glz::buffer_to_file(file_contents, file_path.string()) };
if (glz_err != glz::error_code::none) {
return std::make_error_code(std::errc::io_error);
}
Expand Down
6 changes: 3 additions & 3 deletions libs/confman/testing/tests/file_storage_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ auto main(int argc, char** argv) -> int {
file_testable<test_me> conf{ ctx, file_name, test_me{ .a = observable<int>{ 1 }, .b = "bar" } };
glz::json_t json{};
std::string buffer{};
glz::read_file_json(json, file_name.string(), buffer);
std::ignore = glz::read_file_json(json, file_name.string(), buffer) ;
ut::expect(static_cast<int>(json["a"].get<double>()) == 1);
ut::expect(json["b"].get<std::string>() == "bar");

conf.make_change()->a = 2;
conf.make_change()->b = "test";

buffer = {};
glz::read_file_json(json, file_name.string(), buffer);
std::ignore = glz::read_file_json(json, file_name.string(), buffer);
ut::expect(static_cast<int>(json["a"].get<double>()) == 2);
ut::expect(json["b"].get<std::string>() == "test");
};
Expand Down Expand Up @@ -161,7 +161,7 @@ auto main(int argc, char** argv) -> int {
if (backup_found) {
glz::json_t backup_json{};
std::string buffer{};
glz::read_file_json(backup_json, found_file.string(), buffer);
std::ignore = glz::read_file_json(backup_json, found_file.string(), buffer);

ut::expect(backup_json["a"].as<int>() == 3) << backup_json["a"].as<int>();
ut::expect(backup_json["b"].get<std::string>() == "bar") << backup_json["b"].get<std::string>();
Expand Down
4 changes: 2 additions & 2 deletions libs/stx/inc/public/tfc/stx/glaze_meta.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,12 @@ template <typename duration_t>
constexpr auto parse8601(const std::string& save) -> date::sys_time<duration_t> {
std::istringstream in{ save };
date::sys_time<duration_t> tp;
in >> date::parse("%FT%TZ", tp);
date::from_stream(in, "%FT%TZ", tp);
if (in.fail()) {
in.clear();
in.exceptions(std::ios::failbit);
in.str(save);
in >> date::parse("%FT%T%Ez", tp);
date::from_stream(in, "%FT%T%Ez", tp);
}
return tp;
}
Expand Down

0 comments on commit 6f560ed

Please sign in to comment.