Fabric: Getting rid of `std::to_string()`

Summary:
@public
Suddenly, it is not supported on Android.
Luckelly `folly:to<std::string>()` is as good as `std::to_string()`.

Reviewed By: mdvacca

Differential Revision: D8655538

fbshipit-source-id: 2b3b970f6a261253aaa6b22dba8338dc66b7195d
This commit is contained in:
Valentin Shergin 2018-06-29 12:09:57 -07:00 committed by Facebook Github Bot
parent b81c8b51fc
commit 712c2ed5d2
3 changed files with 6 additions and 6 deletions

View File

@ -50,7 +50,7 @@ inline void fromDynamic(const folly::dynamic &value, FontWeight &result) {
}
inline std::string toString(const FontWeight &fontWeight) {
return std::to_string((int)fontWeight);
return folly::to<std::string>((int)fontWeight);
}
inline void fromDynamic(const folly::dynamic &value, FontStyle &result) {

View File

@ -162,7 +162,7 @@ std::string ShadowNode::getDebugName() const {
}
std::string ShadowNode::getDebugValue() const {
return "r" + std::to_string(revision_) + (getSealed() ? "/sealed" : "");
return "r" + folly::to<std::string>(revision_) + (getSealed() ? "/sealed" : "");
}
SharedDebugStringConvertibleList ShadowNode::getDebugChildren() const {
@ -181,7 +181,7 @@ SharedDebugStringConvertibleList ShadowNode::getDebugChildren() const {
SharedDebugStringConvertibleList ShadowNode::getDebugProps() const {
SharedDebugStringConvertibleList list = {};
list.push_back(std::make_shared<DebugStringConvertibleItem>("tag", std::to_string(tag_)));
list.push_back(std::make_shared<DebugStringConvertibleItem>("tag", folly::to<std::string>(tag_)));
SharedShadowNode sourceNode = getSourceNode();
if (sourceNode) {

View File

@ -166,20 +166,20 @@ SharedDebugStringConvertibleList TreeMutationInstruction::getDebugProps() const
return SharedDebugStringConvertibleList {
std::make_shared<DebugStringConvertibleItem>("parentNode", parentNode_->getDebugDescription(options)),
std::make_shared<DebugStringConvertibleItem>("childNode", newChildNode_->getDebugDescription(options)),
std::make_shared<DebugStringConvertibleItem>("index", std::to_string(index_))
std::make_shared<DebugStringConvertibleItem>("index", folly::to<std::string>(index_))
};
case Removal:
return SharedDebugStringConvertibleList {
std::make_shared<DebugStringConvertibleItem>("parentNode", parentNode_->getDebugDescription(options)),
std::make_shared<DebugStringConvertibleItem>("childNode", oldChildNode_->getDebugDescription(options)),
std::make_shared<DebugStringConvertibleItem>("index", std::to_string(index_))
std::make_shared<DebugStringConvertibleItem>("index", folly::to<std::string>(index_))
};
case Replacement:
return SharedDebugStringConvertibleList {
std::make_shared<DebugStringConvertibleItem>("parentNode", parentNode_->getDebugDescription(options)),
std::make_shared<DebugStringConvertibleItem>("oldChildNode", oldChildNode_->getDebugDescription(options)),
std::make_shared<DebugStringConvertibleItem>("newChildNode", newChildNode_->getDebugDescription(options)),
std::make_shared<DebugStringConvertibleItem>("index", std::to_string(index_))
std::make_shared<DebugStringConvertibleItem>("index", folly::to<std::string>(index_))
};
}
}