Remove @/folly dependency from folly/io:compression
[folly.git] / folly / Varint.h
index 5642f691ccda33a0c8460e2a1ea0920a5d53d081..438cd1b5c3e228c75c06b6aed98d54cf7a6c4491 100644 (file)
@@ -18,6 +18,7 @@
 #define FOLLY_VARINT_H_
 
 #include <type_traits>
+#include <folly/Conv.h>
 #include <folly/Range.h>
 
 namespace folly {
@@ -126,7 +127,8 @@ inline uint64_t decodeVarint(Range<T*>& data) {
     }
     if (p == end) {
       throw std::invalid_argument("Invalid varint value. Too small: " +
-                                  std::to_string(end - begin) + " bytes");
+                                  folly::to<std::string>(end - begin) +
+                                  " bytes");
     }
     val |= static_cast<uint64_t>(*p++) << shift;
   }