1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 01:11:15 +02:00

Move some code

This commit is contained in:
Eelco Dolstra 2019-12-13 19:10:39 +01:00
parent b4edc3ca61
commit ac9cc2ec08
2 changed files with 12 additions and 6 deletions

View file

@ -19,4 +19,15 @@ std::ostream & operator << (std::ostream & str, const String & s)
return str;
}
size_t Source::sourceWrapper(void * _this, rust::Slice<uint8_t> data)
{
try {
// FIXME: how to propagate exceptions?
auto n = ((nix::Source *) _this)->read((unsigned char *) data.ptr, data.size);
return n;
} catch (...) {
abort();
}
}
}