diff options
Diffstat (limited to 'src/libutil/rust-ffi.cc')
-rw-r--r-- | src/libutil/rust-ffi.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libutil/rust-ffi.cc b/src/libutil/rust-ffi.cc index 931d29542..accc5e22b 100644 --- a/src/libutil/rust-ffi.cc +++ b/src/libutil/rust-ffi.cc @@ -1,12 +1,18 @@ #include "logging.hh" #include "rust-ffi.hh" -namespace nix { - extern "C" std::exception_ptr * make_error(rust::StringSlice s) { // FIXME: leak - return new std::exception_ptr(std::make_exception_ptr(Error(std::string(s.ptr, s.size)))); + return new std::exception_ptr(std::make_exception_ptr(nix::Error(std::string(s.ptr, s.size)))); +} + +namespace rust { + +std::ostream & operator << (std::ostream & str, const String & s) +{ + str << (std::string_view) s; + return str; } } |