Cleanup some code

This commit is contained in:
topjohnwu
2023-05-28 23:50:52 -07:00
parent e668dbf6f7
commit f2846694e1
5 changed files with 43 additions and 25 deletions
+6 -1
View File
@@ -120,10 +120,15 @@ struct StringCmp {
};
template<typename T>
rust::Slice<uint8_t> byte_slice(T *buf, size_t sz) {
rust::Slice<uint8_t> u8_mut_slice(T *buf, size_t sz) {
return rust::Slice(reinterpret_cast<uint8_t *>(buf), sz);
}
template<typename T>
rust::Slice<const uint8_t> u8_slice(T *buf, size_t sz) {
return rust::Slice(reinterpret_cast<const uint8_t *>(buf), sz);
}
uint64_t parse_uint64_hex(std::string_view s);
int parse_int(std::string_view s);