Skip to content

Commit

Permalink
migrate map-util to fmt::format
Browse files Browse the repository at this point in the history
Reviewed By: DenisYaroshevskiy, vitaut

Differential Revision: D63991898

fbshipit-source-id: 180672d8efdc513b794603b45c0891a8ecefbafd
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Oct 16, 2024
1 parent 4548678 commit 29fc2e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion folly/container/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ cpp_library(
name = "map_util",
headers = ["MapUtil.h"],
exported_deps = [
"//folly:conv",
"fbsource//third-party/fmt:fmt",
"//folly:optional",
"//folly:range",
"//folly/functional:invoke",
Expand Down
7 changes: 4 additions & 3 deletions folly/container/MapUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@

#include <tuple>

#include <folly/Conv.h>
#include <fmt/format.h>

#include <folly/Optional.h>
#include <folly/Range.h>
#include <folly/functional/Invoke.h>
Expand Down Expand Up @@ -86,7 +87,7 @@ const typename Map::mapped_type& get_or_throw(
if (pos != map.end()) {
return pos->second;
}
throw_exception<E>(folly::to<std::string>(exceptionStrPrefix, key));
throw_exception<E>(fmt::format("{}{}", exceptionStrPrefix, key));
}

template <
Expand All @@ -101,7 +102,7 @@ typename Map::mapped_type& get_or_throw(
if (pos != map.end()) {
return pos->second;
}
throw_exception<E>(folly::to<std::string>(exceptionStrPrefix, key));
throw_exception<E>(fmt::format("{}{}", exceptionStrPrefix, key));
}

/**
Expand Down

0 comments on commit 29fc2e1

Please sign in to comment.